Last active
April 19, 2023 18:58
-
-
Save heiglandreas/e33c695e9aaaf14d459cf0789318d41e to your computer and use it in GitHub Desktop.
SImple test of Intl-Calendar feature set(month)
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
Chinese Calendar | |
int(1) | |
int(0) | |
Islamic Calendar | |
int(8) | |
int(0) | |
Gregorian Calendar | |
int(3) | |
int(0) |
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 | |
// The implementation of the chinese calendar seems to be broken | |
// The months can not be set. | |
echo 'Chinese Calendar' . PHP_EOL; | |
$f = IntlCalendar::createInstance('UTC', '@calendar=chinese'); | |
var_dump($f->get(IntlCalendar::FIELD_MONTH)); | |
$f->set(IntlCalendar::FIELD_MONTH, 0); | |
var_dump($f->get(IntlCalendar::FIELD_MONTH)); | |
echo 'Islamic Calendar' . PHP_EOL; | |
$f = IntlCalendar::createInstance('UTC', '@calendar=islamic'); | |
var_dump($f->get(IntlCalendar::FIELD_MONTH)); | |
$f->set(IntlCalendar::FIELD_MONTH, 0); | |
var_dump($f->get(IntlCalendar::FIELD_MONTH)); | |
echo 'Gregorian Calendar' . PHP_EOL; | |
$f = IntlCalendar::createInstance('UTC'); | |
var_dump($f->get(IntlCalendar::FIELD_MONTH)); | |
$f->set(IntlCalendar::FIELD_MONTH, 0); | |
var_dump($f->get(IntlCalendar::FIELD_MONTH)); | |
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
Chinese Calendar | |
int(1) | |
int(1) | |
Islamic Calendar | |
int(8) | |
int(0) | |
Gregorian Calendar | |
int(3) | |
int(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment