diff --git a/js/app/views/IntervalUI.js b/js/app/views/IntervalUI.js index 42e2f13..f7401f3 100644 --- a/js/app/views/IntervalUI.js +++ b/js/app/views/IntervalUI.js @@ -122,7 +122,7 @@ Ext.define('amdaUI.IntervalUI', { // get stop value var stop = this.getStopTime(); // if duration computable - if (Ext.isDate(start) && Ext.isDate(stop)) { + if (stop != null && start != null) { if ( stop <= start ) { form.findField('stopDate').markInvalid('Stop Time must be after Start Time'); } else { @@ -235,7 +235,7 @@ Ext.define('amdaUI.IntervalUI', { tip: 'Date formatted as YYYY/MM/DD hh:mm:ss.uuu', format: 'Y/m/d H:i:s.u', enforceMaxLength: true, - maxLength: 25, + maxLength: 23, fieldLabel: fieldText, labelAlign: 'left', labelWidth: 60, @@ -248,6 +248,11 @@ Ext.define('amdaUI.IntervalUI', { Ext.create('Ext.tip.ToolTip', { target: c.getEl(), html: c.tip }); }, scope : this + }, + didValueChange: function(newVal, oldVal){ + // 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) + // to be sure to call change event after each modification (during milliseconds change and some other very specific cases) + return true; } }; }, diff --git a/php/classes/RequestMgr.php b/php/classes/RequestMgr.php index 8c4fcc6..53227fe 100644 --- a/php/classes/RequestMgr.php +++ b/php/classes/RequestMgr.php @@ -97,6 +97,10 @@ class RequestMgr extends AmdaObjectMgr $obj->durationHour*3600 + $obj->durationMin*60 + $obj->durationSec; $stopTime = gmdate("Y-m-d\TH:i:s", $time+$interval); + if (empty($obj->durationMs)) { + //compatibility mode -> automatically set durationMs if not exists + $obj->durationMs = "000"; + } $stopTime = $stopTime.'.'.$obj->durationMs; $obj->stopDate = $stopTime; -- libgit2 0.21.2