fomantic / Fomantic-UI

Fomantic-UI is the official community fork of Semantic-UI
https://fomantic-ui.com
MIT License
3.58k stars 333 forks source link

Calender with datetime format DD-MM-YYYY HH:mm changing input value when DD input is 12 or less #3108

Closed badger-github closed 1 month ago

badger-github commented 1 month ago

Bug Report

Using the range calendar with a custom format (DD-MM-YYYY) - when trying a DD value under 12 the custom date format is reversing the DD and MM part This is only an issue if prefilling as if you use the GUI it will show the right format

Steps to reproduce

change the value="" in the start or end input to 01->12 for DD part

Expected result

should take the value input e.g 03-09-2024 should not be changed to "09-03-2024 09:00" prefilling works fine for dates with a DD > 12

Actual result

changed to 09-03-2024 09:00 in the input and then subsequent form submission

Testcase

https://jsbin.com/rupiqaqiqu/1/edit?html,output

version 2.9.3

Hi I really hope this isnt a case of me not reading the documentation properly, wanting to use this module as its great when working. could not see anything similar in open issues. thanks pete

lubber-de commented 1 month ago

Add monthFirst: false

$.fn.calendar.settings.monthFirst = false;

See https://jsbin.com/hojirajajo/1/edit?html,output

badger-github commented 1 month ago

thank you very much for this - apologies I can see that now from documentation

badger-github commented 1 month ago

resolved