Commit 3919a5dfbb6b7571ec4f83440ac463f6f2396c4f

Authored by furkan
1 parent 73beb15b

#10178 - Should be ok

Showing 1 changed file with 21 additions and 17 deletions   Show diff stats
js/app/views/TimeSelectorUI.js
... ... @@ -42,6 +42,11 @@ Ext.define('amdaUI.TimeSelectorUI', {
42 42 if (index === 0) this.TTGrid.getStore().loadData(arrayRec);
43 43 },
44 44  
  45 + timeFormat : function(time){
  46 + return time.substring(0,4) +'/'+ time.substring(5,7)+'/'+time.substring(8,10)
  47 + +' '+time.substring(11,19)+'.000';
  48 + },
  49 +
45 50 addTT : function(newTTName,newTTid) {
46 51 // set the TimeTable radio checked
47 52 var obj = new Object();
... ... @@ -144,7 +149,7 @@ Ext.define('amdaUI.TimeSelectorUI', {
144 149 if (cellIndex == 2)
145 150 this.TTGrid.getStore().remove(record);
146 151 }, this);
147   -
  152 + const self = this;
148 153 this.intervalSel = Ext.create('amdaUI.IntervalUI',
149 154 {
150 155 itemId: 2,
... ... @@ -189,26 +194,25 @@ Ext.define('amdaUI.TimeSelectorUI', {
189 194 || data.records[0].get('nodeType') == 'sharedcatalog')
190 195 {
191 196 AmdaAction.getObject(data.records[0].get('id'), data.records[0].get('nodeType'), function (result, remoteEvent) {
192   - surveyStart = result['surveyStart'];
193   - surveyStop = result['surveyStop'];
194   - if(surveyStart.substring(19,23) == "" && surveyStop.substring(19,23) == "")
195   - {
196   - surveyStart += '.000Z';
197   - surveyStop += ".000Z";
198   - }
199   - surveyStart = '2008/01/01 01:00:00.000';
200   - surveyStop = '2008/01/02 01:00:00.000';
201   - console.log(surveyStart + " " + surveyStop);
202   - targetModule.getUiContent().setTimeFromData({ start : surveyStart, stop : surveyStop});
  197 + surveyStart = self.timeFormat(result['surveyStart']);
  198 + surveyStop = self.timeFormat(result['surveyStop']);
  199 +
  200 + me.setStartTime(surveyStart);
  201 + me.setStopTime(surveyStop);
  202 + //targetModule.getUiContent().setTimeFromData({ start : surveyStart, stop : surveyStop});
203 203 }, this);
204 204 return true;
205 205 }
206 206 else{
207   - console.log(data.records[0].get('globalStart'));
208   -
209   - targetModule.getUiContent().setTimeFromData({ start : data.records[0].get('globalStart'),
210   - stop : data.records[0].get('globalStop')});
211   - me.updateDuration();
  207 + surveyStart = self.timeFormat(data.records[0].get('globalStart'));
  208 + surveyStop = self.timeFormat(data.records[0].get('globalStop'));
  209 +
  210 + //targetModule.getUiContent().setTimeFromData({ start : surveyStart,
  211 + // stop :surveyStart});
  212 +
  213 + me.setStartTime(surveyStart);
  214 + me.setStopTime(surveyStop);
  215 + //me.updateDuration();
212 216 return true;
213 217  
214 218 }
... ...