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

All day events (start time = end time) issue #56

Closed
AlbertoDMendoza opened this issue Oct 1, 2019 · 6 comments
Closed

All day events (start time = end time) issue #56

AlbertoDMendoza opened this issue Oct 1, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@AlbertoDMendoza
Copy link

Yahoo calendar creates all day events by adding the same start time and end time to an event. This causes errors on Google: Event start date must be before event end date. at main(Code:172)

The event in question looks like this on the logs:
Title: Apple picking
Id: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
Description:
Start: Sat Oct 05 2019 17:00:00 GMT-0700 (PDT)
End: Sat Oct 05 2019 17:00:00 GMT-0700 (PDT)

@AlbertoDMendoza AlbertoDMendoza added the bug Something isn't working label Oct 1, 2019
@jonas0b1011001
Copy link
Collaborator

Please take a look at #55 and try the workaround suggested there.

@AlbertoDMendoza
Copy link
Author

error doesn't seem to be with parsing dates, so it doesn't adjust end date., so I assumed an all day event is one that starts and ends 24hrs later. I added this but didn't quite cut it.

 //checking if Startdate equals Enddate
  if (icalEvent.startDate == icalEvent.endDate)
    Logger.log("Start Date and End Date are the same. Adjusting End Date + 1");
    icalEvent.endDate.adjust(1,0,0,0)

@jonas0b1011001
Copy link
Collaborator

Try replacing your code.gs with the following code and try again :)

@AlbertoDMendoza
Copy link
Author

Yup, that did it!
Thanks for the quick reply!

@derekantrican
Copy link
Owner

@jonas0b1011001 Sounds like this might become enough of a problem that we should just account for this in the main code. Something like:

if (duration is 0){
  if (start is date)
    //change duration to 1 day
  else //start is datetime
    //change duration to the "defaultDuration" setting
}

What do you think?

@jonas0b1011001
Copy link
Collaborator

Definitely seems to be a more common error than i thought it would be and might be worth pushing to the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants