Commit 3a8eaaff8f6910725df2659559669626bcb16a3c
1 parent
70c8089a
Exists in
master
and in
65 other branches
resolue
Showing
5 changed files
with
49 additions
and
51 deletions
Show diff stats
js/app/models/Catalog.js
@@ -37,7 +37,7 @@ Ext.define('amdaModel.Catalog', { | @@ -37,7 +37,7 @@ Ext.define('amdaModel.Catalog', { | ||
37 | // } | 37 | // } |
38 | values.objName = this.get('objName'); | 38 | values.objName = this.get('objName'); |
39 | values.objFormat = this.get('objFormat'); | 39 | values.objFormat = this.get('objFormat'); |
40 | - values.folderId = this.get('folderId'); | 40 | + values.folderId = this.get('folderId'); |
41 | values.nbIntervals = this.get('nbIntervals'); | 41 | values.nbIntervals = this.get('nbIntervals'); |
42 | values.cacheToken = this.get('cacheToken'); | 42 | values.cacheToken = this.get('cacheToken'); |
43 | values.parameters = this.get('parameters'); | 43 | values.parameters = this.get('parameters'); |
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] = (item.start); | ||
183 | - stops[index] = (item.stop); | 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'); | ||
184 | }); | 184 | }); |
185 | if(starts.length !== 0 || stops.length !== 0) { | 185 | if(starts.length !== 0 || stops.length !== 0) { |
186 | 186 | ||
@@ -274,8 +274,7 @@ Ext.define('amdaUI.CatalogUI', { | @@ -274,8 +274,7 @@ Ext.define('amdaUI.CatalogUI', { | ||
274 | dateFormat: 'Y-m-d\\TH:i:s.u', | 274 | dateFormat: 'Y-m-d\\TH:i:s.u', |
275 | convert: function (value, rec) { | 275 | convert: function (value, rec) { |
276 | if (!Ext.isDate(value)) { | 276 | if (!Ext.isDate(value)) { |
277 | - var valueString = new String(value); | ||
278 | - return new Date(valueString.replace(/\-/g, '\/').replace(/[T|Z]/g, ' ')); | 277 | + return new Date(value); |
279 | } | 278 | } |
280 | return value; | 279 | return value; |
281 | } | 280 | } |
@@ -286,8 +285,7 @@ Ext.define('amdaUI.CatalogUI', { | @@ -286,8 +285,7 @@ Ext.define('amdaUI.CatalogUI', { | ||
286 | dateFormat: 'Y-m-d\\TH:i:s.u', | 285 | dateFormat: 'Y-m-d\\TH:i:s.u', |
287 | convert: function (value, rec) { | 286 | convert: function (value, rec) { |
288 | if (!Ext.isDate(value)) { | 287 | if (!Ext.isDate(value)) { |
289 | - var valueString = new String(value); | ||
290 | - return new Date(valueString.replace(/\-/g, '\/').replace(/[T|Z]/g, ' ')); | 288 | + return new Date(value); |
291 | } | 289 | } |
292 | return value; | 290 | return value; |
293 | } | 291 | } |
@@ -365,40 +363,36 @@ Ext.define('amdaUI.CatalogUI', { | @@ -365,40 +363,36 @@ Ext.define('amdaUI.CatalogUI', { | ||
365 | } | 363 | } |
366 | }, | 364 | }, |
367 | { | 365 | { |
368 | - xtype: 'datecolumn', | ||
369 | - text: 'Start Time', | ||
370 | - format: 'Y-m-d\\TH:i:s.u', | ||
371 | - sortable: true, | ||
372 | - dataIndex: 'start', | ||
373 | - width: 120, | ||
374 | - minWidth: 50, | ||
375 | - menuDisabled: false, | ||
376 | - editor: { | ||
377 | - xtype: 'datefield', | ||
378 | - allowBlank: false, | ||
379 | - hideTrigger: true, | ||
380 | - format: 'Y-m-d\\TH:i:s.u' | ||
381 | - }, | ||
382 | - filter: {type: 'date', dateFormat: 'Y-m-d'} | 366 | + header: 'Start Time', dataIndex: 'start', width: 120, |
367 | + editor: {xtype: 'datefield', allowBlank: false, hideTrigger: true, format: 'Y-m-d\\TH:i:s.u'}, | ||
368 | + renderer: function (value) { | ||
369 | + if (value != null) { | ||
370 | + if (Ext.isDate(value)) { | ||
371 | + return Ext.Date.format(value, 'Y-m-d\\TH:i:s.u'); | ||
372 | + } else { | ||
373 | + return Ext.Date.format(new Date(value), 'Y-m-d\\TH:i:s.u'); | ||
374 | + } | ||
375 | + } else { | ||
376 | + return value; | ||
377 | + } | ||
378 | + } | ||
383 | }, | 379 | }, |
384 | { | 380 | { |
385 | - xtype: 'datecolumn', | ||
386 | - text: 'Stop Time', | ||
387 | - format: 'Y-m-d\\TH:i:s.u', | ||
388 | - sortable: true, | ||
389 | - dataIndex: 'stop', | ||
390 | - width: 120, | ||
391 | - minWidth: 50, | ||
392 | - menuDisabled: false, | ||
393 | - editor: { | ||
394 | - xtype: 'datefield', | ||
395 | - allowBlank: false, | ||
396 | - hideTrigger: true, | ||
397 | - format: 'Y-m-d\\TH:i:s.u' | ||
398 | - }, | ||
399 | - filter: {type: 'date', dateFormat: 'Y-m-d'} | 381 | + header: 'Stop Time', dataIndex: 'stop', width: 120, |
382 | + editor: {xtype: 'datefield', allowBlank: false, hideTrigger: true, format: 'Y-m-d\\TH:i:s.u'}, | ||
383 | + renderer: function (value) { | ||
384 | + if (value != null) { | ||
385 | + if (Ext.isDate(value)) { | ||
386 | + return Ext.Date.format(value, 'Y-m-d\\TH:i:s.u'); | ||
387 | + } else { | ||
388 | + return Ext.Date.format(new Date(value), 'Y-m-d\\TH:i:s.u'); | ||
389 | + } | ||
390 | + } else { | ||
391 | + return value; | ||
392 | + } | ||
393 | + } | ||
400 | }, | 394 | }, |
401 | - { | 395 | + { |
402 | xtype: 'gridcolumn', | 396 | xtype: 'gridcolumn', |
403 | text: 'Duration (day)', | 397 | text: 'Duration (day)', |
404 | sortable: true, | 398 | sortable: true, |
@@ -894,7 +888,10 @@ Ext.define('amdaUI.CatalogUI', { | @@ -894,7 +888,10 @@ Ext.define('amdaUI.CatalogUI', { | ||
894 | 'isCatalog': true, | 888 | 'isCatalog': true, |
895 | 'data': {} | 889 | 'data': {} |
896 | }; | 890 | }; |
897 | - obj['data'][activeColumn.dataIndex] = value; | 891 | + if(activeColumn.dataIndex == "start" || activeColumn.dataIndex == "stop") |
892 | + obj['data'][activeColumn.dataIndex] = Ext.Date.format(value, 'Y-m-d\\TH:i:s.u'); | ||
893 | + else | ||
894 | + obj['data'][activeColumn.dataIndex] = value; | ||
898 | 895 | ||
899 | //Interval is modified on the server side | 896 | //Interval is modified on the server side |
900 | me.editing = true; | 897 | me.editing = true; |
@@ -1068,7 +1065,7 @@ Ext.define('amdaUI.CatalogUI', { | @@ -1068,7 +1065,7 @@ Ext.define('amdaUI.CatalogUI', { | ||
1068 | emptyText: 'YYYY/MM/DDThh:mm:ss.fff', | 1065 | emptyText: 'YYYY/MM/DDThh:mm:ss.fff', |
1069 | format: 'Y-m-d\\TH:i:s.u', | 1066 | format: 'Y-m-d\\TH:i:s.u', |
1070 | enforceMaxLength: true, | 1067 | enforceMaxLength: true, |
1071 | - maxLength: 19, | 1068 | + maxLength: 25, |
1072 | labelWidth: 60, | 1069 | labelWidth: 60, |
1073 | labelAlign: 'left', | 1070 | labelAlign: 'left', |
1074 | listeners: { | 1071 | listeners: { |
@@ -1084,7 +1081,7 @@ Ext.define('amdaUI.CatalogUI', { | @@ -1084,7 +1081,7 @@ Ext.define('amdaUI.CatalogUI', { | ||
1084 | format: 'Y-m-d\\TH:i:s.u', | 1081 | format: 'Y-m-d\\TH:i:s.u', |
1085 | labelAlign: 'left', | 1082 | labelAlign: 'left', |
1086 | enforceMaxLength: true, | 1083 | enforceMaxLength: true, |
1087 | - maxLength: 19, | 1084 | + maxLength: 25, |
1088 | labelWidth: 60, | 1085 | labelWidth: 60, |
1089 | align: 'left', | 1086 | align: 'left', |
1090 | listeners: { | 1087 | listeners: { |
php/classes/AmdaAction.php
@@ -243,8 +243,8 @@ class AmdaAction | @@ -243,8 +243,8 @@ class AmdaAction | ||
243 | $info .= "<br/>Time Range : depending on mission selection"; | 243 | $info .= "<br/>Time Range : depending on mission selection"; |
244 | else | 244 | else |
245 | $info .= "<br/>Time Range : undefined"; | 245 | $info .= "<br/>Time Range : undefined"; |
246 | - $child->setAttribute('dataStart', date("Y-m-d\TH:i:s\Z", strtotime(' -1 day'))); | ||
247 | - $child->setAttribute('dataStop', date("Y-m-d\TH:i:s\Z", time())); | 246 | + $child->setAttribute('dataStart', date("Y-m-d\TH:i:s.u\Z", strtotime(' -1 day'))); |
247 | + $child->setAttribute('dataStop', date("Y-m-d\TH:i:s.u\Z", time())); | ||
248 | } else { | 248 | } else { |
249 | $info .= "<br/>Time Range: ".$child->getAttribute('dataStart')."-".$child->getAttribute('dataStop'); | 249 | $info .= "<br/>Time Range: ".$child->getAttribute('dataStart')."-".$child->getAttribute('dataStop'); |
250 | } | 250 | } |
@@ -362,7 +362,7 @@ class AmdaAction | @@ -362,7 +362,7 @@ class AmdaAction | ||
362 | else { | 362 | else { |
363 | if (!empty($timeRestriction)) { | 363 | if (!empty($timeRestriction)) { |
364 | $disable = FALSE; | 364 | $disable = FALSE; |
365 | - $formattedTimeRestriction = date("Y-m-d\TH:i:s\Z",strtotime($timeRestriction)+1); | 365 | + $formattedTimeRestriction = date("Y-m-d\TH:i:s.u\Z",strtotime($timeRestriction)+1); |
366 | $info .= "<br/><b>After $formattedTimeRestriction data are restricted to group ".$child->getAttribute('group')."</b>"; | 366 | $info .= "<br/><b>After $formattedTimeRestriction data are restricted to group ".$child->getAttribute('group')."</b>"; |
367 | } | 367 | } |
368 | else { | 368 | else { |
@@ -474,15 +474,15 @@ class AmdaAction | @@ -474,15 +474,15 @@ class AmdaAction | ||
474 | 474 | ||
475 | if ($child->tagName == 'parameter'){ | 475 | if ($child->tagName == 'parameter'){ |
476 | if ($child->parentNode->hasAttribute('dataStart')){ | 476 | if ($child->parentNode->hasAttribute('dataStart')){ |
477 | - $globalStart = date('Y-m-d\TH:i:s\Z', strtotime($child->parentNode->getAttribute('dataStart'))); | ||
478 | - $globalStop = date('Y-m-d\TH:i:s\Z', strtotime($child->parentNode->getAttribute('dataStop'))); | 477 | + $globalStart = date('Y-m-d\TH:i:s.u\Z', strtotime($child->parentNode->getAttribute('dataStart'))); |
478 | + $globalStop = date('Y-m-d\TH:i:s.u\Z', strtotime($child->parentNode->getAttribute('dataStop'))); | ||
479 | } | 479 | } |
480 | } | 480 | } |
481 | 481 | ||
482 | if ( $child->tagName == 'component'){ | 482 | if ( $child->tagName == 'component'){ |
483 | if ($child->parentNode->parentNode->hasAttribute('dataStart')){ | 483 | if ($child->parentNode->parentNode->hasAttribute('dataStart')){ |
484 | - $globalStart = date('Y-m-d\TH:i:s\Z', strtotime($child->parentNode->getAttribute('dataStart'))); | ||
485 | - $globalStop = date('Y-m-d\TH:i:s\Z', strtotime($child->parentNode->getAttribute('dataStop'))); | 484 | + $globalStart = date('Y-m-d\TH:i:s.u\Z', strtotime($child->parentNode->getAttribute('dataStart'))); |
485 | + $globalStop = date('Y-m-d\TH:i:s.u\Z', strtotime($child->parentNode->getAttribute('dataStop'))); | ||
486 | } | 486 | } |
487 | } | 487 | } |
488 | 488 |
php/classes/CatalogCacheIntervalObject.php
@@ -59,7 +59,7 @@ class CatalogCacheIntervalObject extends TimeTableCacheIntervalObject | @@ -59,7 +59,7 @@ class CatalogCacheIntervalObject extends TimeTableCacheIntervalObject | ||
59 | fwrite($handle,pack('d', floatval($value))); | 59 | fwrite($handle,pack('d', floatval($value))); |
60 | break; | 60 | break; |
61 | case 1: //date (timestamp) | 61 | case 1: //date (timestamp) |
62 | - fwrite($handle,pack('L', TimeUtils::iso2stamp($value))); | 62 | + fwrite($handle,pack('d', TimeUtils::iso2stamp($value))); |
63 | break; | 63 | break; |
64 | case 2: //string | 64 | case 2: //string |
65 | fwrite($handle,pack('L', strlen($value))); | 65 | fwrite($handle,pack('L', strlen($value))); |
@@ -101,7 +101,7 @@ class CatalogCacheIntervalObject extends TimeTableCacheIntervalObject | @@ -101,7 +101,7 @@ class CatalogCacheIntervalObject extends TimeTableCacheIntervalObject | ||
101 | $val = $res['val']; | 101 | $val = $res['val']; |
102 | break; | 102 | break; |
103 | case 1: //date (timestamp) | 103 | case 1: //date (timestamp) |
104 | - if (!$res = unpack('Lval',fread($handle,4))) { | 104 | + if (!$res = unpack('dval',fread($handle,8))) { |
105 | break; | 105 | break; |
106 | } | 106 | } |
107 | $val = TimeUtils::stamp2iso($res['val']); | 107 | $val = TimeUtils::stamp2iso($res['val']); |
php/classes/TimeUtils.php
@@ -18,7 +18,8 @@ class TimeUtils | @@ -18,7 +18,8 @@ class TimeUtils | ||
18 | $intStamp = floor($stamp); | 18 | $intStamp = floor($stamp); |
19 | $intMilli = round(($stamp-$intStamp)*1000); | 19 | $intMilli = round(($stamp-$intStamp)*1000); |
20 | // c'est moche mais setTime de php ne prends pas en compte les ms | 20 | // c'est moche mais setTime de php ne prends pas en compte les ms |
21 | - $dateIso = date("Y-m-d\TH:i:s",$intStamp).'.'.strval($intMilli); | 21 | + $strMilli = str_pad(strval($intMilli),3, '0', STR_PAD_LEFT); |
22 | + $dateIso = date("Y-m-d\TH:i:s",$intStamp).'.'.$strMilli; | ||
22 | return $dateIso; | 23 | return $dateIso; |
23 | } | 24 | } |
24 | } | 25 | } |