Closed tendant closed 3 years ago
Thanks for the PR! Please do the following:
Hi Everyone, what's the status of this PR? It's a really important fix. Thanks for the hard work to support org-gcal.
@tendant Can you write some tests in test/org-gcal-test.el
? I've just set up CI, so you should be able to push to the PR and see your tests run (after you rebase on the latest master
).
Added test cases, but below test cases are fine in local testing, but they will fail GitHub CI build. So I have commented out them for now.
(should (equal
(convert-time-to-local-timezone "2021-03-03T11:30:00-08:00" "Europe/Oslo")
"2021-03-03T20:30:00+0100"))
(should (equal
(convert-time-to-local-timezone "2021-03-03T11:30:00-08:00" "America/New_York")
"2021-03-03T14:30:00-0500"))
(should (equal
(convert-time-to-local-timezone "2021-03-03T11:30:00-08:00" "America/Los_Angeles")
"2021-03-03T11:30:00-0800"))
(should (equal
(convert-time-to-local-timezone "2021-03-03T11:30:00-08:00" "Asia/Shanghai")
"2021-03-04T03:30:00+0800"))
Please rename convert-time-to-local-timezone
to org-gcal--convert-time-to-local-timezone
.
Interesting that several cases in the test fail - I wonder if it's a bug in the current snapshot edition.
It might because the OS running test doesn't have timezone information, that's the only part which might depended on the OS.
Yeah maybe. Otherwise it looks good. I presume you've tested this manually against the actual Google Calendar API?
Yes. I did.
It works fine for me with time zone "America/Los_Angeles".
Testing steps:
* test
SCHEDULED: <2021-03-04 Thu 10:00>
* test
:PROPERTIES:
:ETag: ...
...
:END:
:org-gcal:
<2021-03-04 Thu 10:00>
:END:
Thanks for the PR!
Trying to fix #48 by adding org-gcal-local-timezone for fetching events.