DateTimePicker showing seconds with minDate

Hello, I am using DateTimePicker in one of my forms and I have to set minDate to the same day and also remove the seconds from the picker. When I choose minDate(now()) it displays seconds in the picker. Also please let me know how do I make this display the date picker when I click anywhere on DateTimePicker element without using native(false) Thank you so much.
No description
No description
Solution:
->minDate(now()->toDateTimeLocalString(unitPrecision: 'minute'))
Jump to solution
9 Replies
toeknee
toeknee7mo ago
->format() and pass in the selector?
mohdaftab
mohdaftabOP7mo ago
Hi @toeknee , I used the format but it still shows the seconds when I use minDate. Please let me know what do you mean by pass in the selector?
toeknee
toeknee7mo ago
remove seconds with ->seconds(false)
mohdaftab
mohdaftabOP7mo ago
it is not about storage really, it is the display in the form field which is showing seconds selection even with seconds(false)
mohdaftab
mohdaftabOP7mo ago
this is how it is displaying when I use ->seconds(false)->minDate(now()) but if I don't use minDate(now()) it shows without seconds.
No description
mohdaftab
mohdaftabOP7mo ago
bump
Solution
LeandroFerreira
LeandroFerreira7mo ago
->minDate(now()->toDateTimeLocalString(unitPrecision: 'minute'))
mohdaftab
mohdaftabOP7mo ago
It worked great, thank you so much @Leandro Ferreira

Did you find this page helpful?