Skip to content
New issue

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

fix #1930 FrozenTime::setToStringFormat 書式変更 #2190

Merged
merged 1 commit into from
May 18, 2023

Conversation

seto1
Copy link
Collaborator

@seto1 seto1 commented May 17, 2023

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

protected $_marshalFormats = [
    'Y-m-d H:i',
    'Y-m-d H:i:s',
    'Y-m-d\TH:i',
    'Y-m-d\TH:i:s',
    'Y-m-d\TH:i:sP',
];

日付の取り扱いは「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するのが良いのではと思います。

ご確認お願いします。

@ryuring ryuring added the Review レビュー要 label May 17, 2023
@ryuring ryuring requested review from ryuring and gondoh May 17, 2023 05:21
@ryuring
Copy link
Collaborator

ryuring commented May 17, 2023

@gondoh こちらの件、案件利用のシチュエーション踏まえてどう思います?
権藤さんの方で問題ないという判断だったらマージしてよいかと考えています。

@gondoh gondoh merged commit c2fc010 into baserproject:dev-5 May 18, 2023
1 check passed
@gondoh gondoh added this to the 5.0.1 milestone May 18, 2023
@seto1 seto1 deleted the fix-1930 branch November 24, 2023 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review レビュー要
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants