From 299caf98074838ef7fd2e25a0b8224e2b808bde3 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 25 Aug 2014 17:26:22 +0000 Subject: [PATCH] More time fixes: - Also accept string timestamps in Zulu time - Fix change detection causing nextmatch filter to not work --- etemplate/js/et2_widget_date.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_widget_date.js b/etemplate/js/et2_widget_date.js index 284f4323c5..f7888c1e5e 100644 --- a/etemplate/js/et2_widget_date.js +++ b/etemplate/js/et2_widget_date.js @@ -107,7 +107,7 @@ var et2_date = et2_inputWidget.extend( }, set_value: function(_value) { - var old_value = this.getValue(); + var old_value = this._oldValue; if(_value === null || _value === "" || _value === undefined || // allow 0 as empty-value for date and date-time widgets, as that is used a lot eg. in InfoLog _value == 0 && (this._type == 'date-time' || this._type == 'date')) @@ -125,7 +125,7 @@ var et2_date = et2_inputWidget.extend( } // Check for full timestamp - if(typeof _value == 'string' && _value.match(/(\d{4})-(\d{2})-(\d{2})T(\d{2})\:(\d{2})\:(\d{2})[+-](\d{2})\:(\d{2})/)) + if(typeof _value == 'string' && _value.match(/(\d{4})-(\d{2})-(\d{2})T(\d{2})\:(\d{2})\:(\d{2})(?:\.\d{3})?(?:Z|[+-](\d{2})\:(\d{2}))/)) { _value = new Date(_value); }