Skip to content

Conversation

@tijsverkoyen
Copy link
Member

The format from the options, is the one Symfony needs. This is not compatible with DateTime::createfromformat.
In our old docs there is also an example where we pass a DateTime object as min and max date

The format from the options, is the one Symfony needs. This is not compatible with DateTime::createfromformat.
In our old docs there is also an example where we pass a DateTime object as min and max date
@tijsverkoyen
Copy link
Member Author

My code:

        $builder
            ->add(
                'start',
                DateType::class,
                [
                    'data' => new \DateTimeImmutable(),
                    'widget' => 'single_text',
                    'minimum_date' => (new \DateTimeImmutable())->format('d/m/Y'),
                    'maximum_date' => (new \DateTimeImmutable())->format('d/m/Y'),
                ]
            );

If I don't use it correctly, and this PR is just stupid because of my limited knowledge, can you give me a working example?

@sanderdlm sanderdlm merged commit 802db2d into master Oct 20, 2022
@jonasdekeukelaere jonasdekeukelaere deleted the fix-datepickers branch October 11, 2024 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants