Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Validator] Fix a valid Date and Time constraint format#17746

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
javiereguiluz merged 1 commit intosymfony:5.4fromadnen-chouibi:5.4
Mar 22, 2023

Conversation

@adnen-chouibi
Copy link
Contributor

@adnen-chouibiadnen-chouibi commentedJan 14, 2023
edited
Loading

I noticed that the date and time format specified at the start of the documentation is not correct, it should beY-m-d for Date andH:i:s for Time instead of YYYY-MM-DD and HH:MM:SS

@xabbuh
Copy link
Member

I think the previous formats were meant to be human-readable and not something that you could pass todate() orDateTimeInterface::format(). And I think not having the reader to know all the format options is a good thing. But can we somehow end up with something more clear than we have right now to avoid confusion?

adnen-chouibi reacted with eyes emoji

@adnen-chouibi
Copy link
ContributorAuthor

The Date constraint accepts only one format as mentioned in the example, $birthday it should be a string "Y-m-d" formatted value.
There is no other option to use it other than H:i:s for Time() and Y-m-d for Date().

@carsonbotcarsonbot changed the titleFix a valid Date and Time constraint format[Validator] Fix a valid Date and Time constraint formatMar 22, 2023
@javiereguiluz
Copy link
Member

In the code examples we mentioned that those were the only valid format ... but I agree that we could be explicit about this in the explanation too. I added some real example too in case any reader needs help with the PHP date formatting letters.

@adnen-chouibi thanks and congrats on your first Symfony Docs contribution 🎉

adnen-chouibi reacted with heart emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhAwaiting requested review from xabbuhxabbuh is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

4 participants

@adnen-chouibi@xabbuh@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp