orchidsoftware / platform

Orchid is a @laravel package that allows for rapid application development of back-office applications, admin/user panels, and dashboards.
https://orchid.software
MIT License
4.26k stars 631 forks source link

DateTimer format24hr() doesn't work #2742

Closed plamenradev closed 6 months ago

plamenradev commented 8 months ago

Describe the bug When using DateTimer field format24hr(true) method does nothing.

To Reproduce Steps to reproduce the behavior:

  1. Create DateTimer field

    DateTimer::make('open')
    ->title('Opening date')
    ->enableTime()
    ->format24hr()

Expected behavior Time format in 24 hours instead of AM/PM

Desktop (please complete the following information):

Server (please complete the following information):

BrianWendt commented 7 months ago

I don't fully understand the Stimulus controller stuff yet to know why, but it seems at line 47 of vendor\orchid\platform\resources\js\controllers\datetime_controller.js that the key for "time_24hr", "maxDate", "minDate", and "allowEmpty" come back as false. "allowEmpty" doesn't appear to be a supported option on flatpickr in the recent versions but the other 3 do appear to be valid options. Other options like "enableTime" and "dateFormat" are working as expected.

Sorry that I don't have a solution, but that is what I've discovered so far.

lihe6666 commented 6 months ago

image

Yes, you are right. I will follow up on this issue.

lihe6666 commented 6 months ago

1702964945480

2775

lihe6666 commented 6 months ago

@plamenradev This problem can be closed