Skip to content
Snippets Groups Projects
Commit 0129c357 authored by Jared Hancock's avatar Jared Hancock
Browse files

forms: Use standardize date formats from UI

parent 5e3c9f3b
No related branches found
No related tags found
No related merge requests found
...@@ -1139,9 +1139,8 @@ class DatetimePickerWidget extends Widget { ...@@ -1139,9 +1139,8 @@ class DatetimePickerWidget extends Widget {
$config = $this->field->getConfiguration(); $config = $this->field->getConfiguration();
if ($this->value) { if ($this->value) {
$this->value = (is_int($this->value) ? $this->value : $this->value = is_int($this->value) ? $this->value :
DateTime::createFromFormat($cfg->getDateFormat(), $this->value) strtotime($this->value);
->format('U'));
if ($config['gmt']) if ($config['gmt'])
$this->value += 3600 * $this->value += 3600 *
$_SESSION['TZ_OFFSET']+($_SESSION['TZ_DST']?date('I',$this->value):0); $_SESSION['TZ_OFFSET']+($_SESSION['TZ_DST']?date('I',$this->value):0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment