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

[Form] reverse transform RFC 3339 formatted dates#28712

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
nicolas-grekas merged 1 commit intosymfony:2.8fromxabbuh:issue-28699-html5
Oct 14, 2018

Conversation

@xabbuh
Copy link
Member

QA
Branch?2.8
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#28699
LicenseMIT
Doc PR

Technically, dates formatted according to the HTML specifications do not
contain any timezone information. But since our DateTimeType used to
contain this information in the passed, users had configure their JS
libraries to accept (and create) dates in that format.

To not break BC we should accept these dates and silently ignore the
additional timezone information.

danrot, sstok, and sheeep reacted with thumbs up emojidanrot and sheeep reacted with heart emoji
}

if (!preg_match('/^(\d{4})-(\d{2})-(\d{2})[T ]\d{2}:\d{2}(?::\d{2})?$/',$dateTimeLocal,$matches)) {
if (!preg_match('/^(\d{4})-(\d{2})-(\d{2})[T ]\d{2}:\d{2}(?::\d{2})?(?:\.\d)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?$/',$dateTimeLocal,$matches)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Maybe it would be possible to also support timezone without ":"?
if (!preg_match('/^(\d{4})-(\d{2})-(\d{2})[T ]\d{2}:\d{2}(?::\d{2})?(?:\.\d)?(?:Z|(?:(?:\+|-)\d{2}:\d{2})|(?:\+|-)\d{4})?$/', $dateTimeLocal, $matches)) {

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can you give an example string of what you have in mind so I can add it to the tests?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

2018-09-15T10:00:00+0200

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

done, thank you for the feedback

darles reacted with thumbs up emoji
Technically, dates formatted according to the HTML specifications do notcontain any timezone information. But since our DateTimeType used tocontain this information in the passed, users had configure their JSlibraries to accept (and create) dates in that format.To not break BC we should accept these dates and silently ignore theadditional timezone information.
Copy link
Contributor

@HeahDudeHeahDude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for fixing this!
Shouldn't we deprecate this behavior in master to be able to use a strict check in Symfony 5?

@magnetik
Copy link
Contributor

+1 for being clearer about what should work and not to be able to be stricter in the future

@xabbuh
Copy link
MemberAuthor

@HeahDude Yeah, I am already preparing some PRs to improve DX around this.

@xabbuh
Copy link
MemberAuthor

@HeahDude see#28724

HeahDude reacted with thumbs up emoji

@danrot
Copy link
Contributor

@xabbuh Do you already know if this will be accepted? Because if it is not we have to fix our JS, otherwise we would only have to add this version as conflict, and we could release a new working version immediately.

@xabbuh
Copy link
MemberAuthor

@danrot Adding the conflict rule will be enough.

@danrot
Copy link
Contributor

danrot commentedOct 10, 2018
edited
Loading

I've added the conflict for symfony 3.4.16 and 3.4.17 in ourcomposer.json, but if you don't set our latest version (1.6.22) as minimum in the project composer.json, composer will install Sulu 1.6.21, so that it can use Symfony 3.4.17, which then still breaks the installation (hope you understand what I mean, otherwise I can elaborate further 🙈).

So people are really struggling with the installation of our product... Is there any other thing we can do, apart from kindly asking you to get this merged and release it? 😊

@YetiCGN
Copy link

I've added the conflict for symfony 3.4.16 and 3.4.17 in ourcomposer.json, but if you don't set our latest version (1.6.22) as minimum in the project composer.json, composer will install Sulu 1.6.21, so that it can use Symfony 3.4.17, which then still breaks the installation (hope you understand what I mean, otherwise I can elaborate further 🙈).

Huh? I have "sulu/sulu": "~1.6.0", as a dependency in several projects (all of our Sulu projects, actually) andcomposer update correctly installs Sulu 1.6.22. The only time this would fail is if people did the update last week when Sulu 1.6.22 wasn't out yet but Symfony 3.4.17 was already - like we did. But even then an Update after the release of Sulu 1.6.22 fixed it. Why would you think people are locked to Sulu 1.6.21?

@danrot
Copy link
Contributor

danrot commentedOct 10, 2018
edited
Loading

Just tested it again, had a project with"sulu/sulu": "~1.6.22", where 1.6.22 was installed, no surpirse so far. Then I changed mycomposer.json in the following way (I assume that's what most Sulu users have in theircomposer.json):

-        "sulu/sulu": "~1.6.22",+        "sulu/sulu": "~1.6.0",

Then I executed anothercomposer update, and that's the output:

daniel@macbook ~/D/s/sulu-standard $ composer updateLoading composer repositories with package information                                                                                                                                                             Updating dependencies (including require-dev)                                                                                                                                                                      Package operations: 0 installs, 3 updates, 0 removals                                                                                                                                                                - Updating symfony/symfony (v3.4.15 => v3.4.17): Loading from cache                                                                                                                                                - Downgrading sulu/sulu (1.6.22 => 1.6.21):  Checking out c0c04cd95e                                                                                                                                               - Updating dantleech/phpcr-migrations-bundle (1.0.0 => 1.1.0): Loading from cache

In addition to that composer even tells me that Symfony is the reason for not installing 1.6.22:

daniel@macbook ~/D/s/sulu-standard $ composer why-not sulu/sulu 1.6.22sulu/sulu  1.6.22  conflicts  symfony/symfony (2.8.10 || 3.4.12 || 3.4.16 || 3.4.17)

Just realized that it works, if the"sulu/sulu" require is before the"symfony/symfony" require 😕 Feels a bit weird, but we can't fix that for existing projects 😞

@YetiCGN
Copy link

Just realized that it works, if the"sulu/sulu" require is before the"symfony/symfony" require 😕 Feels a bit weird, but we can't fix that for existing projects 😞

Ah! See, we have "config": { "sort-packages": true }, in all our projects, which puts Sulu before Symfony. 🙂

@danrot
Copy link
Contributor

And sincesort-packages will be the default with symfony flex, that doesn't make me feel more comfortable 🙈 That means that if we have a conflict with a package that is ordered after sulu alphabetically there is no way to fix this 😕

@YetiCGN
Copy link

Anyhow, please somebody merge this to the LTS branches 2.8 and 3.4 so we can safely rely on backwards compatibility again. 🙂

@nicolas-grekas
Copy link
Member

Thank you@xabbuh.

@nicolas-grekasnicolas-grekas merged commit503239f intosymfony:2.8Oct 14, 2018
nicolas-grekas added a commit that referenced this pull requestOct 14, 2018
This PR was merged into the 2.8 branch.Discussion----------[Form] reverse transform RFC 3339 formatted dates| Q             | A| ------------- | ---| Branch?       | 2.8| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#28699| License       | MIT| Doc PR        |Technically, dates formatted according to the HTML specifications do notcontain any timezone information. But since our DateTimeType used tocontain this information in the passed, users had configure their JSlibraries to accept (and create) dates in that format.To not break BC we should accept these dates and silently ignore theadditional timezone information.Commits-------503239f reverse transform RFC 3339 formatted dates
@xabbuhxabbuh deleted the issue-28699-html5 branchOctober 14, 2018 18:37
This was referencedNov 3, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

2 more reviewers

@darlesdarlesdarles left review comments

@HeahDudeHeahDudeHeahDude approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

2.8

Development

Successfully merging this pull request may close these issues.

8 participants

@xabbuh@magnetik@danrot@YetiCGN@nicolas-grekas@darles@HeahDude@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp