I am trying to allow users to enter (type into) a date field the format of DD/MM/YYYY but I cant seem to get pickerFormat to work. If you type say 10/05/2022 it sets the date to October but the expectation is for it to set to may 10.
Support Forum
Date formatting depends on localization settings you used.
Please check the guide https://bryntum.com/docs/gantt/guide/Gantt/customization/localization#change-date-formats
All the best,
Alex
I am not sure how I use that with the date fields.
I tried:
const locale = {
DateHelper : {
parsers: {
L : "DD.MM.YYYY",
LT : "HH:mm"
}
}
}
Gantt.localeManager.extendLocale('En', locale);
It would be nice to have something similar to format like inputFormat that quickly changes the input format for a date text box.
You need to set locale
with the country code, it will apply date/time formatting according to international standards, see mentioned guide, we also have demo in 'examples/localization'.
const locale = {
DateHelper : {
locale : 'es-ES'
}
}
If you type say 10/05/2022 it sets the date to October but the expectation is for it to set to may 10.
Could you please show what exactly doesn't work for you when you set https://bryntum.com/docs/gantt/api/Core/widget/DateField#config-format for particular field?
And steps to reproduce.
All the best,
Alex
I ran across an issue using this format property. If you use a format such as DD/MM/YYYY or MM/DD/YYYY when you start typing in the field it locks up once you hit the year. example type 05/01/ and then it freezes. After its done freezing it then begins to work. You can see an example here:
https://templates.oneplan.ai/gantt/examples/advanced/
Pick any item and edit the start. Start typing a date into the field and you will see it freeze up.
Reproduced! Thank you for your report. Here is a ticket https://github.com/bryntum/support/issues/4602