frappe / gantt

Open Source Javascript Gantt
https://frappe.io/gantt
MIT License
4.6k stars 1.02k forks source link

Error on Task Date Parsing #361

Closed agencetelecom closed 9 months ago

agencetelecom commented 10 months ago

I juste test it with documented sample and change to custom date

var tasks = [
  {
    id: 'Task 1',
    name: 'Redesign website',
    start: '2023-11-28',
    end: '2024-02-31',
    progress: 20,
    dependencies: 'Task 2, Task 3',
    custom_class: 'bar-milestone' // optional
  }
]
var gantt = new Gantt("#gantt", tasks, {
    header_height: 50,
    column_width: 30,
    step: 24,
    view_modes: ['Week', 'Month'],
    bar_height: 20,
    bar_corner_radius: 3,
    arrow_curve: 5,
    padding: 18,
    view_mode: 'Month',
    date_format: 'YYYY-MM-DD',
    language: 'en', // or 'es', 'it', 'ru', 'ptBr', 'fr', 'tr', 'zh', 'de', 'hu'
    custom_popup_html: null
});

the date 2024-02-31 is interpreted as March 2 (from 2024-2-3 with YYYY-DD-MM) that did not correspond to the date_format parameter i try to change local from en to fr same parsing error

LeeWheeler commented 9 months ago

comment out the line dependencies: 'Task 2, Task 3',

Does it work then ?

agencetelecom commented 9 months ago

sorry for the long delay i finally understand my mistake

@LeeWheeler removing dependencies did not change the behavior

now my mistake ... dumb mistake, the date 2024-02-31 did not exist month only have 29 days so date parsing try to auto correct it by adding excess days to the following month