itchyny / calendar.vim

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

Timezone #86

Closed michaelmior closed 9 years ago

michaelmior commented 9 years ago

There seems to be some sort of timezone issue because all of my events are offset by several hours.

itchyny commented 9 years ago

Please update to the latest version. That bug must be fixed.

michaelmior commented 9 years ago

I just installed yesterday and I checked and I am indeed running the latest version. Times are 8 hours off for me (both my calendar and my computer running vim are in EST/EDT).

itchyny commented 9 years ago

Please check the time string in ~/.cache/calendar.vim/google/event/{calendarstring}/2015/4/0. Search by /datetime. Let me know the result of :echo calendar#time#time_zone().

michaelmior commented 9 years ago

I have strings such as '2015-04-02T14:30:00-04:00', which is correct. My time zone shows as 14400. Instead of the event showing at 14:30, it shows at 22:30.

itchyny commented 9 years ago

My bad. I found a bug in my code. Thank you for reporting.

michaelmior commented 9 years ago

Thanks! This is working now :)

petobens commented 9 years ago

I have an event that starts at 10:00 (am) but the app shows that it starts at 13:00 . I checked the the time string and it says : 'dateTime': '2015-05-05T10:00:00-03:00'. The strange thing is that :echo calendar#time#time_zone() always returns 0.

itchyny commented 9 years ago

@petobens Let me know the result of :echo strftime('%z').

petobens commented 9 years ago

@itchyny, :echo strftime('%z') returns Argentina Standard Time.

itchyny commented 9 years ago

That seems to be wired. The function strftime with the format %z should return the time offset from UTF in the format [+-]hh:mm. Please set the time zone with the following configuration in vimrc.

let g:calendar_time_zone = '-03:00'
petobens commented 9 years ago

@itchyny thank you! That solves my problem.