diff --git a/js/app/views/CatalogUI.js b/js/app/views/CatalogUI.js index a5b4222..3f6f7df 100644 --- a/js/app/views/CatalogUI.js +++ b/js/app/views/CatalogUI.js @@ -179,8 +179,8 @@ Ext.define('amdaUI.CatalogUI', { return; } Ext.Array.each(result.intervals, function (item, index) { - starts[index] = Ext.Date.format(item.start, 'Y-m-d\\TH:i:s.u'); - stops[index] = Ext.Date.format(item.start, 'Y-m-d\\TH:i:s.u'); + starts[index] = new Date(item.start); + stops[index] = new Date(item.start); }); if(starts.length !== 0 || stops.length !== 0) { @@ -188,6 +188,10 @@ Ext.define('amdaUI.CatalogUI', { stops.sort(); s = new Date(starts[0]); e = new Date(stops[stops.length - 1]); + + s = Ext.Date.format(s, 'Y-m-d\\TH:i:s.u'); + e = Ext.Date.format(e, 'Y-m-d\\TH:i:s.u'); + if(! ttObj.get('surveyStart') ){ ttObj.set('surveyStart', s); this.status.isModified = true; @@ -1312,21 +1316,32 @@ Ext.define('amdaUI.CatalogUI', { defaults: {anchor: '100%'}, layout: 'anchor', items :[{ - fieldLabel: 'Start Time', - name: 'surveyStart', - emptyText: 'YYYY/MM/DDThh:mm:ss.fff', - format: 'Y-m-d\\TH:i:s.u', - enforceMaxLength: true, - maxLength: 25, - labelWidth: 60, - labelAlign: 'left', - listeners: { - change: this.onChangeStartField, - focus: function(field) { - this.activeField = 'surveyStart'; - }, + fieldLabel: 'Start Time', + name: 'surveyStart', + emptyText: 'YYYY/MM/DDThh:mm:ss.fff', + format: 'Y-m-d\\TH:i:s.u', + enforceMaxLength: true, + maxLength: 25, + labelWidth: 60, + labelAlign: 'left', + renderer: function (value) { + if (value != null) { + if (Ext.isDate(value)) { + return Ext.Date.format(value, 'Y-m-d\\TH:i:s.u'); + } else { + return Ext.Date.format(new Date(value), 'Y-m-d\\TH:i:s.u'); } - }, { + } else { + return value; + } + }, + listeners: { + change: this.onChangeStartField, + focus: function(field) { + this.activeField = 'surveyStart'; + }, + } + }, { fieldLabel: 'Stop Time', name: 'surveyStop', emptyText: 'YYYY/MM/DDThh:mm:ss.fff', -- libgit2 0.21.2