We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the following unit tests to tests/Zend/Date/DateObjectTest.php,
public function testNewDateLocaleTW() { // a mimic of the way that openmage calls the code in zh_TW locale, from [app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php](https://github.com/OpenMage/magento-lts/blob/main/app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php), function _showLastExecutionTime $date = new Zend_Date("2020-01-13 10:00:03", "yyyy-MM-dd HH:mm:ss", null); $this->assertTrue($date instanceof Zend_Date); $date2 = new Zend_Date($date, null, 'zh_TW'); $this->assertTrue($date2 instanceof Zend_Date); } public function testNewDateLocaleTWDirect() { //minimal bug repo $dateString = '2020年1月13日 上午1:00:03'; $format = 'y年M月d日 ah:mm:ss'; $this->assertTrue(new Zend_Date($dateString, $format, 'zh_TW') instanceof Zend_Date); }
Run the unit test:
There were 2 errors: 1) Zend_Date_DateObjectTest::testNewDateLocale1 Zend_Date_Exception: Unable to parse date '2020年1月13日 上午1:00:03' using 'y年M月d日 ah:mm:ss' (M <> d) /mnt/e/github/zf1-future/library/Zend/Date.php:2540 /mnt/e/github/zf1-future/library/Zend/Date.php:1002 /mnt/e/github/zf1-future/library/Zend/Date.php:197 /mnt/e/github/zf1-future/tests/Zend/Date/DateObjectTest.php:670 Caused by Zend_Locale_Exception: Unable to parse date '2020年1月13日 上午1:00:03' using 'y年M月d日 ah:mm:ss' (M <> d) /mnt/e/github/zf1-future/library/Zend/Locale/Format.php:1080 /mnt/e/github/zf1-future/library/Zend/Locale/Format.php:1175 /mnt/e/github/zf1-future/library/Zend/Date.php:2506 /mnt/e/github/zf1-future/library/Zend/Date.php:1002 /mnt/e/github/zf1-future/library/Zend/Date.php:197 /mnt/e/github/zf1-future/tests/Zend/Date/DateObjectTest.php:670 2) Zend_Date_DateObjectTest::testNewDateLocale2 Zend_Date_Exception: Unable to parse date '2020年1月13日 上午10:00:03' using 'y年M月d日 ah:mm:ss' (M <> d) /mnt/e/github/zf1-future/library/Zend/Date.php:2540 /mnt/e/github/zf1-future/library/Zend/Date.php:1002 /mnt/e/github/zf1-future/library/Zend/Date.php:197 /mnt/e/github/zf1-future/tests/Zend/Date/DateObjectTest.php:677 Caused by Zend_Locale_Exception: Unable to parse date '2020年1月13日 上午10:00:03' using 'y年M月d日 ah:mm:ss' (M <> d) /mnt/e/github/zf1-future/library/Zend/Locale/Format.php:1080 /mnt/e/github/zf1-future/library/Zend/Locale/Format.php:1175 /mnt/e/github/zf1-future/library/Zend/Date.php:2506 /mnt/e/github/zf1-future/library/Zend/Date.php:1002 /mnt/e/github/zf1-future/library/Zend/Date.php:197 /mnt/e/github/zf1-future/tests/Zend/Date/DateObjectTest.php:677
I'm using PHP 8.1.2
The text was updated successfully, but these errors were encountered:
Nice.
Sorry, something went wrong.
No branches or pull requests
Add the following unit tests to tests/Zend/Date/DateObjectTest.php,
Run the unit test:
I'm using PHP 8.1.2
The text was updated successfully, but these errors were encountered: