| @@ 207-221 (lines=15) @@ | ||
| 204 | * |
|
| 205 | * @return IntlDateFormatter |
|
| 206 | */ |
|
| 207 | protected function getInternalFormatter() |
|
| 208 | { |
|
| 209 | $formatter = IntlDateFormatter::create( |
|
| 210 | i18n::config()->uninherited('default_locale'), |
|
| 211 | IntlDateFormatter::NONE, |
|
| 212 | IntlDateFormatter::MEDIUM, |
|
| 213 | date_default_timezone_get() // Default to server timezone |
|
| 214 | ); |
|
| 215 | $formatter->setLenient(false); |
|
| 216 | ||
| 217 | // Note we omit timezone from this format, and we assume server TZ always. |
|
| 218 | $formatter->setPattern(DBTime::ISO_TIME); |
|
| 219 | ||
| 220 | return $formatter; |
|
| 221 | } |
|
| 222 | ||
| 223 | public function getAttributes() |
|
| 224 | { |
|
| @@ 265-277 (lines=13) @@ | ||
| 262 | * |
|
| 263 | * @return IntlDateFormatter |
|
| 264 | */ |
|
| 265 | protected function getInternalFormatter() |
|
| 266 | { |
|
| 267 | $locale = i18n::config()->uninherited('default_locale'); |
|
| 268 | $formatter = IntlDateFormatter::create( |
|
| 269 | i18n::config()->uninherited('default_locale'), |
|
| 270 | IntlDateFormatter::MEDIUM, |
|
| 271 | IntlDateFormatter::NONE |
|
| 272 | ); |
|
| 273 | $formatter->setLenient(false); |
|
| 274 | // CLDR ISO 8601 date. |
|
| 275 | $formatter->setPattern(DBDate::ISO_DATE); |
|
| 276 | return $formatter; |
|
| 277 | } |
|
| 278 | ||
| 279 | public function getAttributes() |
|
| 280 | { |
|