Our state of the art Gantt chart


Post by jhughesoneplan »

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.


Post by alex.l »

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


Post by jhughesoneplan »

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.


Post by alex.l »

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


Post by jhughesoneplan »

I was able to get format to work. I was using pickerFormat. What is the difference?


Post by alex.l »

locale applies formatting for all fields in the app, field setting applies it for that field only.

All the best,
Alex


Post by jhughesoneplan »

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.


Post by tasnim »

Reproduced! Thank you for your report. Here is a ticket https://github.com/bryntum/support/issues/4602


Post Reply