0

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);
it shows the 'end' is string, not object. it has to be getEvents(object,object)

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.

1
  • please mark as answered if that solved your issue. Commented Nov 4, 2018 at 1:51

1 Answer 1

1

Utilities.formatDate() converts the date object into a string. So, use

var end = coach_date.setDate(coach_date.getDate()+1);
Sign up to request clarification or add additional context in comments.

2 Comments

TypeError: cannot call method "setDate" of undefined.(line 114, file "xxxx")
@J.W. define coach_date

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.