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 datetimepicker with jQuery 3.6 #357

Merged
merged 3 commits into from
May 24, 2022

Conversation

franmomu
Copy link
Member

@franmomu franmomu commented May 23, 2022

Subject

Fixes sonata-project/SonataAdminBundle#7830

@fracsi if you could give it a try

I am targeting this branch, because this is BC.

Changelog

### Changed
- Fix compatibility of `bootstrap-datetimepicker` with jQuery 3

@franmomu franmomu added the patch label May 23, 2022
@jordisala1991
Copy link
Member

Tomorrow I will take a look, it might not be enough reading: Eonasdan/tempus-dominus#1657

@jordisala1991
Copy link
Member

I did a test of this with a basic date time picker and a date picker and it works, not sure if there is an advanced behavior that is still wrong but the basic:

use Sonata\Form\Type\DatePickerType;
use Sonata\Form\Type\DateTimePickerType;

->add('fake', DateTimePickerType::class, [
    'mapped' => false,
])
->add('fake2', DatePickerType::class, [
    'mapped' => false,
])

works fine with this change.

@jordisala1991
Copy link
Member

Can you fix PHPStan?

@franmomu
Copy link
Member Author

I'll see if I can take a look later, but maybe we should deprecate passing an array as argument 1.

Copy link
Member

@jordisala1991 jordisala1991 left a comment

Choose a reason for hiding this comment

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

I would say that the changelog should mention compatibility with jQuery 3 instead on what you changed. It is preferred to know what you fixed.

@VincentLanglet VincentLanglet merged commit 5df6d6d into sonata-project:1.x May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jQuery 3.6 broke datetimepicker
3 participants