diff --git a/js/app/views/PlotComponents/PlotPreviewUI.js b/js/app/views/PlotComponents/PlotPreviewUI.js index 410f189..209d36f 100644 --- a/js/app/views/PlotComponents/PlotPreviewUI.js +++ b/js/app/views/PlotComponents/PlotPreviewUI.js @@ -143,7 +143,9 @@ Ext.define('amdaPlotComp.PlotPreviewUI', { this.crtContext = configResult.context; this.panelImage.setSrc(this.getImageUrl(configResult.folder, configResult.plotFile)); - + var newTime = new Date(configResult.time); + newTime = Ext.Date.add(newTime, Ext.Date.MINUTE, newTime.getTimezoneOffset()); + Ext.getCmp('plotPreview-goto-Date' + configResult.interactiveId).setValue(newTime); var size = this.getImageSize(); this.panelImage.setSize(size.width, size.height); @@ -155,7 +157,8 @@ Ext.define('amdaPlotComp.PlotPreviewUI', { this.crtContext = configResult.context; this.interactiveId = configResult.interactiveId; - this.time = configResult.time; + this.time = new Date(configResult.time); + this.time = Ext.Date.add(this.time, Ext.Date.MINUTE, this.time.getTimezoneOffset()); this.panelId= configResult.panelId this.coordinatesField = new Ext.toolbar.TextItem({ @@ -211,7 +214,8 @@ Ext.define('amdaPlotComp.PlotPreviewUI', { scope: this, handler: function (bt) { var newTime = Ext.getCmp('plotPreview-goto-Date' + me.interactiveId).getValue(); - me.panelResultInstance.callInteractivePlot({ 'action': 'instant', 'interactiveId': me.panelResultInstance.interactiveId, 'panelId': me.panelId, 'time': newTime }); + newTime = Ext.Date.add(newTime, Ext.Date.MINUTE, -newTime.getTimezoneOffset()); + me.panelResultInstance.callInteractivePlot({ 'action': 'instant', 'interactiveId': me.panelResultInstance.interactiveId, 'panelId': me.panelId, 'time': newTime.toISOString()}); } }, '-', @@ -220,9 +224,7 @@ Ext.define('amdaPlotComp.PlotPreviewUI', { text : 'Previous', handler: function(){ var newTime = new Date(amdaPlotComp.PlotContextManager.getInstantTimePrev(me.crtContext)*1000); - newTime = Ext.Date.add(newTime, Ext.Date.MINUTE, newTime.getTimezoneOffset()); - Ext.getCmp('plotPreview-goto-Date' + me.interactiveId).setValue(newTime); - me.panelResultInstance.callInteractivePlot({ 'action': 'instant', 'interactiveId': me.panelResultInstance.interactiveId, 'panelId': me.panelId, 'time': newTime }); + me.panelResultInstance.callInteractivePlot({ 'action': 'instant', 'interactiveId': me.panelResultInstance.interactiveId, 'panelId': me.panelId, 'time': newTime.toISOString()}); } }, { @@ -230,9 +232,7 @@ Ext.define('amdaPlotComp.PlotPreviewUI', { text : 'Next', handler: function(){ var newTime = new Date(amdaPlotComp.PlotContextManager.getInstantTimeNext(me.crtContext) *1000); - newTime = Ext.Date.add(newTime, Ext.Date.MINUTE, newTime.getTimezoneOffset()); - me.panelResultInstance.callInteractivePlot({ 'action': 'instant', 'interactiveId': me.panelResultInstance.interactiveId, 'panelId': me.panelId, 'time': newTime }); - Ext.getCmp('plotPreview-goto-Date' + me.interactiveId).setValue(newTime); + me.panelResultInstance.callInteractivePlot({ 'action': 'instant', 'interactiveId': me.panelResultInstance.interactiveId, 'panelId': me.panelId, 'time': newTime.toISOString()}); } } ] diff --git a/js/app/views/PlotTabResultUI.js b/js/app/views/PlotTabResultUI.js index 908a2a4..c0a84ec 100644 --- a/js/app/views/PlotTabResultUI.js +++ b/js/app/views/PlotTabResultUI.js @@ -332,8 +332,8 @@ Ext.define('amdaUI.PlotTabResultUI', { handler: function () { var crtTime = new Date(crtTimestamp * 1000); - crtTime = Ext.Date.add(crtTime, Ext.Date.MINUTE, crtTime.getTimezoneOffset()); - me.callInteractivePlot({ 'action': 'instant', 'interactiveId': this.interactiveId, 'panelId': panel.id, 'time': crtTime }); + //crtTime = Ext.Date.add(crtTime, Ext.Date.MINUTE, crtTime.getTimezoneOffset()); + me.callInteractivePlot({ 'action': 'instant', 'interactiveId': this.interactiveId, 'panelId': panel.id, 'time': crtTime.toISOString()}); }, scope: me }, -- libgit2 0.21.2