I am creating a todo app in nativescript using this plugin by Eddy https://github.com/EddyVerbruggen/nativescript-calendar.
The issue i have is with the date option, precisely startDate and endDate.
i am trying to set the day of the event e.g November 31, 2016 and the time it starts e.g 8:00am. In the doc, it is done like this:
//an Event for now + 1 hour, lasting 1 hour.
startDate: new Date(new Date().getTime() + (60*60*1000)),
endDate: new Date(new Date().getTime() + (2*60*60*1000))
i have tried diffrent ways to achieve what i need but none works.
My latest trial is shown below and it gives the error getTime() is not a function:
startDate: new Date(Date(viewModel.scheduleDay).getTime() + (60*60*1000)),
startDate: new Date(Date(viewModel.scheduleDay).getTime() + (60*60*1000)),
i tired just to get for same day, it worked using this:
startDate: new Date(new Date().setTime(viewModel.scheduleTime)),
endDate: new Date(new Date().setTime(viewModel.scheduleTime))
What i need to do is set the date and time for the event to start.
Thanks.