Commit 3a8eaaff8f6910725df2659559669626bcb16a3c

Authored by Hacene SI HADJ MOHAND
1 parent 70c8089a

resolue

js/app/models/Catalog.js
... ... @@ -37,7 +37,7 @@ Ext.define('amdaModel.Catalog', {
37 37 // }
38 38 values.objName = this.get('objName');
39 39 values.objFormat = this.get('objFormat');
40   - values.folderId = this.get('folderId');
  40 + values.folderId = this.get('folderId');
41 41 values.nbIntervals = this.get('nbIntervals');
42 42 values.cacheToken = this.get('cacheToken');
43 43 values.parameters = this.get('parameters');
... ...
js/app/views/CatalogUI.js
... ... @@ -179,8 +179,8 @@ Ext.define('amdaUI.CatalogUI', {
179 179 return;
180 180 }
181 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 185 if(starts.length !== 0 || stops.length !== 0) {
186 186  
... ... @@ -274,8 +274,7 @@ Ext.define('amdaUI.CatalogUI', {
274 274 dateFormat: 'Y-m-d\\TH:i:s.u',
275 275 convert: function (value, rec) {
276 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 279 return value;
281 280 }
... ... @@ -286,8 +285,7 @@ Ext.define('amdaUI.CatalogUI', {
286 285 dateFormat: 'Y-m-d\\TH:i:s.u',
287 286 convert: function (value, rec) {
288 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 290 return value;
293 291 }
... ... @@ -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 396 xtype: 'gridcolumn',
403 397 text: 'Duration (day)',
404 398 sortable: true,
... ... @@ -894,7 +888,10 @@ Ext.define('amdaUI.CatalogUI', {
894 888 'isCatalog': true,
895 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 896 //Interval is modified on the server side
900 897 me.editing = true;
... ... @@ -1068,7 +1065,7 @@ Ext.define('amdaUI.CatalogUI', {
1068 1065 emptyText: 'YYYY/MM/DDThh:mm:ss.fff',
1069 1066 format: 'Y-m-d\\TH:i:s.u',
1070 1067 enforceMaxLength: true,
1071   - maxLength: 19,
  1068 + maxLength: 25,
1072 1069 labelWidth: 60,
1073 1070 labelAlign: 'left',
1074 1071 listeners: {
... ... @@ -1084,7 +1081,7 @@ Ext.define('amdaUI.CatalogUI', {
1084 1081 format: 'Y-m-d\\TH:i:s.u',
1085 1082 labelAlign: 'left',
1086 1083 enforceMaxLength: true,
1087   - maxLength: 19,
  1084 + maxLength: 25,
1088 1085 labelWidth: 60,
1089 1086 align: 'left',
1090 1087 listeners: {
... ...
php/classes/AmdaAction.php
... ... @@ -243,8 +243,8 @@ class AmdaAction
243 243 $info .= "<br/>Time Range : depending on mission selection";
244 244 else
245 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 248 } else {
249 249 $info .= "<br/>Time Range: ".$child->getAttribute('dataStart')."-".$child->getAttribute('dataStop');
250 250 }
... ... @@ -362,7 +362,7 @@ class AmdaAction
362 362 else {
363 363 if (!empty($timeRestriction)) {
364 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 366 $info .= "<br/><b>After $formattedTimeRestriction data are restricted to group ".$child->getAttribute('group')."</b>";
367 367 }
368 368 else {
... ... @@ -474,15 +474,15 @@ class AmdaAction
474 474  
475 475 if ($child->tagName == 'parameter'){
476 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 482 if ( $child->tagName == 'component'){
483 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 59 fwrite($handle,pack('d', floatval($value)));
60 60 break;
61 61 case 1: //date (timestamp)
62   - fwrite($handle,pack('L', TimeUtils::iso2stamp($value)));
  62 + fwrite($handle,pack('d', TimeUtils::iso2stamp($value)));
63 63 break;
64 64 case 2: //string
65 65 fwrite($handle,pack('L', strlen($value)));
... ... @@ -101,7 +101,7 @@ class CatalogCacheIntervalObject extends TimeTableCacheIntervalObject
101 101 $val = $res['val'];
102 102 break;
103 103 case 1: //date (timestamp)
104   - if (!$res = unpack('Lval',fread($handle,4))) {
  104 + if (!$res = unpack('dval',fread($handle,8))) {
105 105 break;
106 106 }
107 107 $val = TimeUtils::stamp2iso($res['val']);
... ...
php/classes/TimeUtils.php
... ... @@ -18,7 +18,8 @@ class TimeUtils
18 18 $intStamp = floor($stamp);
19 19 $intMilli = round(($stamp-$intStamp)*1000);
20 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 23 return $dateIso;
23 24 }
24 25 }
... ...