Take yyyy-mm-ddThh:mm:ss.s format into account for date widget.

- Fix Date widget doesn't let iOS html native datetime-local input set a value
This commit is contained in:
Hadi Nategh 2016-07-21 14:28:32 +02:00
parent e3132b7775
commit 5c3bd11366

View File

@ -467,7 +467,7 @@ String: A string in the user\'s date format, or a relative date. Relative dates
_value = date('Y-m-d\\TH:i:s\\Z', _value);
}
// Check for full timestamp
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}))/))
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);
}