From 7c236e57751e21b1e51a5e1ebac9b8d72f4d0e93 Mon Sep 17 00:00:00 2001 From: Furkan Date: Tue, 20 Sep 2022 14:31:15 +0200 Subject: [PATCH] #10576 - Pb with surveyStart and surveyStop in CatMGr resolved --- js/app/views/CatalogUI.js | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) 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