mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Only used normalised ISO on HTML5
This commit is contained in:
parent
de8abe1167
commit
f01a20d5c4
@ -311,7 +311,13 @@ class DatetimeField extends TextField
|
||||
$formatter->setLenient(false);
|
||||
|
||||
// Note we omit timezone from this format, and we always assume server TZ
|
||||
$formatter->setPattern(DBDatetime::ISO_DATETIME_NORMALISED);
|
||||
if ($this->getHTML5()) {
|
||||
// ISO8601 date with a standard "T" separator (W3C standard).
|
||||
$formatter->setPattern(DBDatetime::ISO_DATETIME_NORMALISED);
|
||||
} else {
|
||||
// ISO8601 date with a whitespace separator
|
||||
$formatter->setPattern(DBDatetime::ISO_DATETIME);
|
||||
}
|
||||
|
||||
return $formatter;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user