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
toeknee5mo ago
->format() and pass in the selector?
mohdaftab
mohdaftabOP5mo 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
toeknee5mo ago
remove seconds with ->seconds(false)
mohdaftab
mohdaftabOP5mo 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
mohdaftabOP5mo 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
mohdaftabOP4mo ago
bump
Solution
LeandroFerreira
LeandroFerreira4mo ago
->minDate(now()->toDateTimeLocalString(unitPrecision: 'minute'))
mohdaftab
mohdaftabOP4mo ago
It worked great, thank you so much @Leandro Ferreira
Want results from more Discord servers?
Add your server