Commit 7c236e57751e21b1e51a5e1ebac9b8d72f4d0e93

Authored by Erdogan Furkan
1 parent 13374f3f

#10576 - Pb with surveyStart and surveyStop in CatMGr resolved

Showing 1 changed file with 31 additions and 16 deletions   Show diff stats
js/app/views/CatalogUI.js
@@ -179,8 +179,8 @@ Ext.define('amdaUI.CatalogUI', { @@ -179,8 +179,8 @@ Ext.define('amdaUI.CatalogUI', {
179 return; 179 return;
180 } 180 }
181 Ext.Array.each(result.intervals, function (item, index) { 181 Ext.Array.each(result.intervals, function (item, index) {
182 - starts[index] = Ext.Date.format(item.start, 'Y-m-d\\TH:i:s.u');  
183 - stops[index] = Ext.Date.format(item.start, 'Y-m-d\\TH:i:s.u'); 182 + starts[index] = new Date(item.start);
  183 + stops[index] = new Date(item.start);
184 }); 184 });
185 if(starts.length !== 0 || stops.length !== 0) { 185 if(starts.length !== 0 || stops.length !== 0) {
186 186
@@ -188,6 +188,10 @@ Ext.define('amdaUI.CatalogUI', { @@ -188,6 +188,10 @@ Ext.define('amdaUI.CatalogUI', {
188 stops.sort(); 188 stops.sort();
189 s = new Date(starts[0]); 189 s = new Date(starts[0]);
190 e = new Date(stops[stops.length - 1]); 190 e = new Date(stops[stops.length - 1]);
  191 +
  192 + s = Ext.Date.format(s, 'Y-m-d\\TH:i:s.u');
  193 + e = Ext.Date.format(e, 'Y-m-d\\TH:i:s.u');
  194 +
191 if(! ttObj.get('surveyStart') ){ 195 if(! ttObj.get('surveyStart') ){
192 ttObj.set('surveyStart', s); 196 ttObj.set('surveyStart', s);
193 this.status.isModified = true; 197 this.status.isModified = true;
@@ -1312,21 +1316,32 @@ Ext.define('amdaUI.CatalogUI', { @@ -1312,21 +1316,32 @@ Ext.define('amdaUI.CatalogUI', {
1312 defaults: {anchor: '100%'}, 1316 defaults: {anchor: '100%'},
1313 layout: 'anchor', 1317 layout: 'anchor',
1314 items :[{ 1318 items :[{
1315 - fieldLabel: 'Start Time',  
1316 - name: 'surveyStart',  
1317 - emptyText: 'YYYY/MM/DDThh:mm:ss.fff',  
1318 - format: 'Y-m-d\\TH:i:s.u',  
1319 - enforceMaxLength: true,  
1320 - maxLength: 25,  
1321 - labelWidth: 60,  
1322 - labelAlign: 'left',  
1323 - listeners: {  
1324 - change: this.onChangeStartField,  
1325 - focus: function(field) {  
1326 - this.activeField = 'surveyStart';  
1327 - }, 1319 + fieldLabel: 'Start Time',
  1320 + name: 'surveyStart',
  1321 + emptyText: 'YYYY/MM/DDThh:mm:ss.fff',
  1322 + format: 'Y-m-d\\TH:i:s.u',
  1323 + enforceMaxLength: true,
  1324 + maxLength: 25,
  1325 + labelWidth: 60,
  1326 + labelAlign: 'left',
  1327 + renderer: function (value) {
  1328 + if (value != null) {
  1329 + if (Ext.isDate(value)) {
  1330 + return Ext.Date.format(value, 'Y-m-d\\TH:i:s.u');
  1331 + } else {
  1332 + return Ext.Date.format(new Date(value), 'Y-m-d\\TH:i:s.u');
1328 } 1333 }
1329 - }, { 1334 + } else {
  1335 + return value;
  1336 + }
  1337 + },
  1338 + listeners: {
  1339 + change: this.onChangeStartField,
  1340 + focus: function(field) {
  1341 + this.activeField = 'surveyStart';
  1342 + },
  1343 + }
  1344 + }, {
1330 fieldLabel: 'Stop Time', 1345 fieldLabel: 'Stop Time',
1331 name: 'surveyStop', 1346 name: 'surveyStop',
1332 emptyText: 'YYYY/MM/DDThh:mm:ss.fff', 1347 emptyText: 'YYYY/MM/DDThh:mm:ss.fff',