Commit f3648bf22a3039b350da6cbac4ecb0614575e7af

Authored by Benjamin Renard
1 parent d7e14b21

Fix for milliseconds support

Showing 2 changed files with 11 additions and 2 deletions   Show diff stats
js/app/views/IntervalUI.js
... ... @@ -122,7 +122,7 @@ Ext.define('amdaUI.IntervalUI', {
122 122 // get stop value
123 123 var stop = this.getStopTime();
124 124 // if duration computable
125   - if (Ext.isDate(start) && Ext.isDate(stop)) {
  125 + if (stop != null && start != null) {
126 126 if ( stop <= start ) {
127 127 form.findField('stopDate').markInvalid('Stop Time must be after Start Time');
128 128 } else {
... ... @@ -235,7 +235,7 @@ Ext.define(&#39;amdaUI.IntervalUI&#39;, {
235 235 tip: 'Date formatted as YYYY/MM/DD hh:mm:ss.uuu',
236 236 format: 'Y/m/d H:i:s.u',
237 237 enforceMaxLength: true,
238   - maxLength: 25,
  238 + maxLength: 23,
239 239 fieldLabel: fieldText,
240 240 labelAlign: 'left',
241 241 labelWidth: 60,
... ... @@ -248,6 +248,11 @@ Ext.define(&#39;amdaUI.IntervalUI&#39;, {
248 248 Ext.create('Ext.tip.ToolTip', { target: c.getEl(), html: c.tip });
249 249 },
250 250 scope : this
  251 + },
  252 + didValueChange: function(newVal, oldVal){
  253 + // Fix BRE - Override didValueChange function (from https://docs.sencha.com/extjs/4.2.3/extjs-build/docs/source/Field2.html#Ext-form-field-Field-event-change)
  254 + // to be sure to call change event after each modification (during milliseconds change and some other very specific cases)
  255 + return true;
251 256 }
252 257 };
253 258 },
... ...
php/classes/RequestMgr.php
... ... @@ -97,6 +97,10 @@ class RequestMgr extends AmdaObjectMgr
97 97 $obj->durationHour*3600 +
98 98 $obj->durationMin*60 + $obj->durationSec;
99 99 $stopTime = gmdate("Y-m-d\TH:i:s", $time+$interval);
  100 + if (empty($obj->durationMs)) {
  101 + //compatibility mode -> automatically set durationMs if not exists
  102 + $obj->durationMs = "000";
  103 + }
100 104 $stopTime = $stopTime.'.'.$obj->durationMs;
101 105 $obj->stopDate = $stopTime;
102 106  
... ...