-
-
Save Spriz/d396e30451ab263b98c2e3b92dffaedd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Cake\I18n\Date; | |
use Cake\I18n\FrozenDate; | |
use Cake\I18n\FrozenTime; | |
use Cake\I18n\Time; | |
// Default config stuff | |
/* | |
* Set default date & time for both mutable and immutable values | |
*/ | |
$dateTimeToStringFormat = [ | |
IntlDateFormatter::MEDIUM, | |
IntlDateFormatter::SHORT, | |
]; | |
$dateToStringFormat = [ | |
IntlDateFormatter::SHORT, | |
IntlDateFormatter::NONE, | |
]; | |
$locale = 'nl-NL'; | |
FrozenTime::setDefaultLocale($locale); | |
Time::setDefaultLocale($locale); | |
FrozenDate::setDefaultLocale($locale); | |
Date::setDefaultLocale($locale); | |
FrozenTime::setToStringFormat($dateTimeToStringFormat); | |
Time::setToStringFormat($dateTimeToStringFormat); | |
FrozenDate::setToStringFormat($dateToStringFormat); | |
Date::setToStringFormat($dateToStringFormat); | |
FrozenTime::$niceFormat = $dateTimeToStringFormat; | |
Time::$niceFormat = $dateTimeToStringFormat; | |
FrozenDate::$niceFormat = $dateToStringFormat; | |
Date::$niceFormat = $dateToStringFormat; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Cake\I18n\Time; | |
$troubledTimeInstance = new Time(); | |
debug($troubledTimeInstance); | |
debug(\Cake\I18n\Time::getDefaultLocale()); | |
debug(\Cake\I18n\I18n::getLocale()); | |
debug(\Cake\I18n\I18n::getDefaultLocale()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment