fix #1930 FrozenTime::setToStringFormat 書式変更 #2190
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
issue: #1930
BcFormHelper->dateTimePickerのhiddenの日時が「Y/m/d H:i:s」形式だと、エンティティ変換時にnullになってしまうため「Y-m-d H:i:s」に変更しています。
「Y/m/d H:i:s」だと以下のフォーマットに含まれていないためnullになります。
https://github.com/cakephp/cakephp/blob/4.x/src/Database/Type/DateTimeType.php
日付の取り扱いは「Y-m-d」の方が統一されているようです。
https://ja.wikipedia.org/wiki/%E6%97%A5%E4%BB%98#%E5%B9%B4%E6%9C%88%E6%97%A5%E3%81%AE%E9%A0%86%E5%BA%8F%E3%81%AE%E6%B7%B7%E4%B9%B1
基本的に、日付の取り回しは「Y-m-d」の形式で、必要に応じて表示のタイミングでformatするのが良いのではと思います。
ご確認お願いします。