Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on Task Date Parsing #361

Closed
agencetelecom opened this issue Oct 25, 2023 · 2 comments
Closed

Error on Task Date Parsing #361

agencetelecom opened this issue Oct 25, 2023 · 2 comments

Comments

@agencetelecom
Copy link

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
Copy link

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

Does it work then ?

@agencetelecom
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants