Premium support for our pure JavaScript UI components


Post by CegekaItaly »

We are trying to add a ReleaseDate field in the event edit pop-up. But unfortunately when we add this field in the extraItems, the Gantt component does not recognize the date in the correct format. Its interpretation changes according to the web language. What are we doing wrong? In the documentation there is no example (or at least we did not found it) where a case like this is treated.
Thank you in advance.
Configgantt.PNG
Configgantt.PNG (14.5 KiB) Viewed 508 times

Post by sergey.maltsev »

Hi!

To parse date you could specify your format for your model
https://www.bryntum.com/docs/scheduler/#Common/data/Model
class MyModel extends EventModel {
  static get fields() {
    return [
      ...
      { name : 'releaseDate', type : 'date' , format : 'YYYY-MM-DD'},
    ];
}
You also could set a desired dateFormat for dateField in event edit.
https://www.bryntum.com/docs/scheduler/#Common/widget/DateField#config-format
    features : {
        eventEdit : {
            extraItems : [
                {
                    type        : 'date',
                    label       : 'Release date',
                    name        : 'releaseDate',
                    format      : 'YYYY-MM-DD'
                }
            ]
        }
    }

Post Reply