Skip to content

Commit 7334c96

Browse files
committed
Improve debugging for date parse failures
1 parent a3ec43f commit 7334c96

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

LDK/resources/web/LDK/ConvertUtils.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LDK.ConvertUtils = new function(){
1818
//@private
1919

2020
//adapted from Ext.field.Date. will parse a date in the given format, returning null if it does not match
21-
function safeParseDate(value, format, useStrict){
21+
function safeParseDate(value, format, useStrict, verboseLogging){
2222
var result = null,
2323
parsedDate;
2424

@@ -54,7 +54,8 @@ LDK.ConvertUtils = new function(){
5454
}
5555
}
5656

57-
if (this.verboseLogging) {
57+
// TODO: added for insight into TeamCity test failures. Ultimately remove this.
58+
if (verboseLogging && result) {
5859
var msg = 'Parsing, raw value: ' + value + ', format: ' + format + ', result: ' + result;
5960
console.log(msg);
6061

@@ -101,7 +102,7 @@ LDK.ConvertUtils = new function(){
101102

102103
var val;
103104
for (var i=0; i < formats.length; ++i) {
104-
val = safeParseDate(value, formats[i]);
105+
val = safeParseDate(value, formats[i], true, verboseLogging);
105106
if (val) {
106107
break;
107108
}

0 commit comments

Comments
 (0)