0

Trying to use sycfusion vue scheduler but when looking at docs example link

This is the event data from the example in docs which has StartTime as January 15th 2008

let data = [{
Id: 1,
Subject: 'Paris',
StartTime: new Date(2018, 1, 15, 10, 0),
EndTime: new Date(2018, 1, 15, 12, 30),
IsAllDay: false,
RecurrenceRule: 'FREQ=DAILY;INTERVAL=1;COUNT=5'
}];

But in preview events are showing after one month from the StartTime on February 15th instead of january. Is this a bug or am I missing something?

Abhilash
  • 2,864
  • 3
  • 33
  • 67

1 Answers1

1

That's not a bug - months in the Date object are 0-indexed, so it works properly.

new Date(2018, 1, 15, 10, 0) // Thu Feb 15 2018 10:00:00
new Date(2018, 0, 15, 10, 0) // Mon Jan 15 2018 10:00:00

More about Date object here

Cheetha
  • 706
  • 3
  • 4