Commit b4c976eb2b02a130652670e2d822cb6390bfbb3f

Authored by Hacene SI HADJ MOHAND
1 parent 9c5e376e

pack unpack ne marche pas

js/app/views/TimeTableUI.js
... ... @@ -542,7 +542,7 @@ Ext.define('amdaUI.TimeTableUI', {
542 542 'isCatalog': false,
543 543 'data': {}
544 544 };
545   - obj['data'][activeColumn.dataIndex] = value;
  545 + obj['data'][activeColumn.dataIndex] = Ext.Date.format(value, 'Y-m-d\\TH:i:s.u');
546 546  
547 547 //context.grid.getSelectionModel().deselectAll();
548 548 //Interval is modified on the server side
... ... @@ -614,9 +614,6 @@ Ext.define('amdaUI.TimeTableUI', {
614 614 header: 'Start Time', dataIndex: 'start', width: 120,
615 615 editor: {xtype: 'datefield', allowBlank: false, hideTrigger: true, format: 'Y-m-d\\TH:i:s.u'},
616 616 renderer: function (value) {
617   - console.log(value);
618   - console.log(value.getMilliseconds());
619   - console.log(Ext.Date.format(value, 'Y-m-d\\TH:i:s.u'))
620 617 if (value != null) {
621 618 if (Ext.isDate(value)) {
622 619 return Ext.Date.format(value, 'Y-m-d\\TH:i:s.u');
... ...
php/classes/TimeTableCacheIntervalObject.php
... ... @@ -107,17 +107,20 @@ class TimeTableCacheIntervalObject
107 107 }
108 108  
109 109 public function writeBin($handle) {
110   - fwrite($handle,pack('L6',$this->id,$this->index,$this->start,$this->stop,$this->isNew,$this->isModified));
  110 +
  111 + fwrite($handle,pack('f6',$this->id,$this->index,$this->start,$this->stop,$this->isNew,$this->isModified));
111 112 }
112 113  
113 114 public function loadBin($handle) {
114   - $array = unpack('L6int',fread($handle,6*4));
115   - $this->id = $array['int1'];
116   - $this->index = $array['int2'];
117   - $this->start = $array['int3'];
118   - $this->stop = $array['int4'];
119   - $this->isNew = $array['int5'];
120   - $this->isModified = $array['int6'];
  115 + $binData = fread($handle,6*4);
  116 + error_log($binData);
  117 + $array = unpack('f6f',$binData);
  118 + $this->id = intval($array['f1']);
  119 + $this->index = intval($array['f2']);
  120 + $this->start = $array['f3'];
  121 + $this->stop = $array['f4'];
  122 + $this->isNew = intval($array['f5']);
  123 + $this->isModified = intval($array['f6']);
121 124 }
122 125  
123 126 public function dump() {
... ...
php/classes/TimeUtils.php
... ... @@ -9,7 +9,7 @@ class TimeUtils
9 9 catch (Exception $e) {
10 10 $time = new DateTime('1970-01-01T00:00:00Z');
11 11 }
12   - $stamp = $time->format('U');
  12 + $stamp = $time->format('U.u');
13 13 unset($time);
14 14 return $stamp;
15 15 }
... ...