From 1fe67f2c6a7d8372e722eb905fd3ad6521ffc582 Mon Sep 17 00:00:00 2001 From: Hacene SI HADJ MOHAND Date: Fri, 4 Mar 2022 11:48:33 +0100 Subject: [PATCH] progress --- js/app/models/TimeTable.js | 10 +++------- js/app/views/TimeTableUI.js | 4 ++-- php/classes/TimeTableCacheMgr.php | 4 ++-- php/classes/TimeTableMgr.php | 2 +- php/classes/TimeUtils.php | 2 +- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/js/app/models/TimeTable.js b/js/app/models/TimeTable.js index 1303137..b7ad9bc 100644 --- a/js/app/models/TimeTable.js +++ b/js/app/models/TimeTable.js @@ -29,19 +29,15 @@ Ext.define('amdaModel.Interval', { { name: 'start', type : 'date', defaultValue : new Date(), convert: function(value,rec) { if (!Ext.isDate(value)){ - var valueString = new String(value); - var date = new Date(valueString.replace(/\-/g,'\/').replace(/[T|Z]/g,' ')); - return date; + return new Date(value); } return value; } }, { name: 'stop', type : 'date', defaultValue : new Date(), convert: function(value,rec) { - if (!Ext.isDate(value)){ - var valueString = new String(value); - var date = new Date(valueString.replace(/\-/g,'\/').replace(/[T|Z]/g,' ')); - return date; + if (!Ext.isDate(value)){ + return new Date(value); } return value; } diff --git a/js/app/views/TimeTableUI.js b/js/app/views/TimeTableUI.js index cf20b33..3bf3033 100755 --- a/js/app/views/TimeTableUI.js +++ b/js/app/views/TimeTableUI.js @@ -510,8 +510,8 @@ Ext.define('amdaUI.TimeTableUI', { {type: 'numeric', dataIndex: 'durationHour'}, {type: 'numeric', dataIndex: 'durationMin'}, {type: 'numeric', dataIndex: 'durationSec'}, - {type: 'date', dataIndex: 'start', dateFormat: 'Y-m-d'}, - {type: 'date', dataIndex: 'stop', dateFormat: 'Y-m-d'} + {type: 'date', dataIndex: 'start', dateFormat: 'c'}, + {type: 'date', dataIndex: 'stop', dateFormat: 'c'} ] }; var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', { diff --git a/php/classes/TimeTableCacheMgr.php b/php/classes/TimeTableCacheMgr.php index 08328cb..a13e512 100644 --- a/php/classes/TimeTableCacheMgr.php +++ b/php/classes/TimeTableCacheMgr.php @@ -240,10 +240,10 @@ $index = 0; if (!isset($start)) - $start = date('Y-m-d\TH:i:s'); + $start = date('Y-m-d\TH:i:s.u'); if (!isset($stop)) - $stop = date('Y-m-d\TH:i:s'); + $stop = date('Y-m-d\TH:i:s.u'); $this->cache->addInterval(array('start' => $start, 'stop' => $stop), true, $index); diff --git a/php/classes/TimeTableMgr.php b/php/classes/TimeTableMgr.php index 1e9a1cc..ff496cd 100644 --- a/php/classes/TimeTableMgr.php +++ b/php/classes/TimeTableMgr.php @@ -200,7 +200,7 @@ class TimeTableMgr extends AmdaObjectMgr } $this->id = $this->setId(); - $this->created = date('Y-m-d\TH:i:s'); + $this->created = date('Y-m-d\TH:i:s.u'); if (!$this->id) { return ['error' => ID_CREATION_ERROR]; } diff --git a/php/classes/TimeUtils.php b/php/classes/TimeUtils.php index 5bc32c4..b0f9864 100644 --- a/php/classes/TimeUtils.php +++ b/php/classes/TimeUtils.php @@ -15,7 +15,7 @@ class TimeUtils } public static function stamp2iso($stamp) { - return date('Y-m-d\TH:i:s',$stamp); + return date('Y-m-d\TH:i:s.u',$stamp); } } -- libgit2 0.21.2