itchyny / calendar.vim

A calendar application for Vim
MIT License
1.95k stars 72 forks source link

Events spanning days #91

Closed jackfischer closed 9 years ago

jackfischer commented 9 years ago

Love the plugin, noticed a strange effect with an event spanning more than one day. Draws a three day event (3rd-5th) as two days. screen shot 2015-06-19 at 4 23 51 pm screen shot 2015-06-19 at 4 22 13 pm

itchyny commented 9 years ago

There might be inconsistency between the time zone settings. What is the result of :strftime('%z') and is that correct time zone offset for you?

jackfischer commented 9 years ago

Get Not an editor command: strftime('%z'), but :echo strftime("%z") gives -0400 which is correct.

itchyny commented 9 years ago

Uh, yes, my bad, that's what I indented to.

I need more information. How did you create the event? What do you expect it to be? Is that an event with the time range specified or not? What is the time zone setting of the calendar viewed on the Google Calendar web site (My Calendars → Calendar settings)?

jackfischer commented 9 years ago

No problem, event was created in google calendar, all day 7/3/2015-7/5/2015 (no time range) The time zone of the calendar is also GMT -04:00.

itchyny commented 9 years ago

Is the plugin updated to the HEAD? Please confirm with git pull.

jackfischer commented 9 years ago

Yes, up to date

itchyny commented 9 years ago

I want you to investigate the cache file. Please look into the file ~/.cache/calendar.vim/google/event/{calendarId}/yyyy/mm/0. What does start.dateTime or start.date look like?

jackfischer commented 9 years ago

'start': {'date': '2015-07-03'} 'end': {'date': '2015-07-06'}

These are correct, but the calendar shows it as starting 07-02 and ending 07-05 (exclusive)

itchyny commented 9 years ago

I do not stil understand what causes the problem.

Please check if the following command shows the intended event.

:echo calendar#google#calendar#getEvents(2015, 7)['2015-7-3']

I'm grad if you paste the result with some confidential parts removed away (you may remove summary, organizer, creator, calendarId etc away).

jackfischer commented 9 years ago

That command gives the error E716: Key not present in Dictionary: 2015-7-3 E15: Invalid expression: calendar#google#calendar#getEvents(2015, 7)['2015-7-3']

but changing it to ['2015-7-2'] gives

{'events': [{'endtime': '20:00', 'endymd': [2015, 7, 4], 'summary': '___', 'endhms': [20, 0, 0], 'start': {'date': '2015-07-03'}, 'isTimeEvent': 0, 'status': 'confirmed', 'reminders': {'useDefault': 0, 'overrides': [{'method': 'popup', 'minutes': 30}]}, 'id': '___', 'sequence': 0, 'organizer' : {'email': '', 'displayName': 'Jack Fischer', 'self': 1}, 'isHoliday': 0, 'starttime': '20:00', 'iCalUID': '___', 'hms': [20, 0, 0], 'syntax': 'truc', 'isWeekNum': 0, 'calendarSummary': '', 'htmlLink': '___', 'isMoon': 0, 'kind': 'calendar#event', 'end': {'date': '2015-07-06'}, 'isDayNum': 0, 'etag': '"___"', 'creator': {'email': '', 'displayName': 'Jack Fischer', 'self': 1}, 'ymd': [2015, 7, 2], 'sec': 72000, 'created': '2015-06-07T18:53:28.000Z', 'calendarId': '', 'upd ated': '2015-06-07T18:53:28.663Z'},...

itchyny commented 9 years ago

I fixed the problem. Please pull the repository and confirm.

jackfischer commented 9 years ago

Completely fixed! Thank you!