Reputation: 1
I have a question about the date convert: in sheet, I have a date '05/11/2018', I need to get next date 06/11/2018.
var end=Utilities.formatDate(new Date(coach_date.getTime()+1*3600000*24), 'GMT', 'dd/MM/yyyy');
var start = new Date();
var events = calendar.getEvents(start,end);
so I used end = new Date(end); it got '11/06/2018', change month from Nov to June.
How could I fix it, then use it on getevents() feature. Thanks a lot.
Upvotes: 0
Views: 980
Reputation: 50443
Utilities.formatDate()
converts the date object into a string. So, use
var end = coach_date.setDate(coach_date.getDate()+1);
Upvotes: 1