-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
wrong times for events after DST change #142
Comments
This is same as #95 and is a known issue. But I'm not planning to support DST switch in the near future, sorry. |
Would you accept a PR about this feature? |
The solution to this problem is probably rather simple. You can define timezone as a +/- hour:minute or as "Europe/Amsterdam". The first definition is fixed and doesn't keep track of DST. If you use the second definition google calendar automatically takes care of DST. As a proof of concept, you can verify with calendar.vim that this works by changing the definition of set_timezone here
Now all changes and additions are done according to DST. This doesn't take care of how the hours in the calendar are shown though. Somewhere (I couldn't find where) this must be changed to the +/-hour:minute-suffix format. As far as I know, google calendar returns the time according to the timezone set in the calendar. |
Found where the time is corrected. You could change this line and make timezone (defined +/- hour:minute) dependent one the date and time to be converted: calendar.vim/autoload/calendar/time.vim Line 135 in 8d4ab7a
From vim v8.1.2326 there is the strptime function that can be used for this: |
In short, with this fix you'll probably want to remove this line:
and each time |
Basically not that terribly difficult. You need two changes: One here: calendar.vim/autoload/calendar/time.vim Line 28 in 8d4ab7a
change the first two lines in this function
and add code to pass the original string from the datetime function. I've attached the changed file. You would probably also have to add code to check that a:str is in the correct format to be read by strptime. And a oneliner here:
into
I would propose that you check first whether |
Been using this solutions for a month now. It seems to work without any problems. |
It would be very cool if we could get this in. |
The problem seems more serious than just a matter of display. I added today (well before DST change) an event in late March (after the DST change for where I am) by pressing |
I am in the CEST (UTC+2) time zone. We are on Daylight Saving Time until the last Sunday in October, when we will switch to CET (UTC+1). (Google) Calendar events planned after the time switch are shown in CEST time; so, for instance, I have a meeting at 2:00 PM on 5th November which calendar.vim shows at 3:00 PM. I think the event time should rather appear in the time zone which will be in use on that day.
The text was updated successfully, but these errors were encountered: