lcbrq / magento2-dateformatpatch
修复lib-icu不一致性返回不同地区模式的补丁
1.0.0
2017-10-27 12:03 UTC
Requires
- php: ~5.6.5|7.0.2|7.0.4|~7.0.6|~7.1.0
This package is not auto-updated.
Last update: 2024-09-17 18:08:26 UTC
README
针对 Magento 2 中 "Invalid input datetime format of value" +00201717 问题,又一款补丁。
问题可能源于不严格的 IntlDateFormatter 行为,根据 ICU 数据版本的差异返回 'dd.MM.y' 或 'dd.MM.yyyy' 的简短模式。
<?php date_default_timezone_set("Europe/Warsaw"); locale_set_default('en_US_POSIX'); $format = (new \IntlDateFormatter( 'pl_PL', \IntlDateFormatter::SHORT, \IntlDateFormatter::NONE ))->getPattern(); echo $format;
结果可以是 dd.MM.y 或 dd.MM.yyyy,其中 Magento 接受 datetime 元素中的 dd.MM.y。