aidam38 / roamsr

Spaced Repetition in Roam Research
https://roamresearch.com/#/app/roam-depot-developers/page/uQSCwVKx0
98 stars 18 forks source link

Fix local date bug #23

Closed lboller closed 3 years ago

lboller commented 3 years ago

This is a fantastic plugin. Thanks for making it!

I noticed a problem with the date parser that resulted in cards that were scheduled for tomorrow getting pulled into the review deck today. Turns out it was a timezone issue.

Given my timezone, the parser was returning tomorrow's date as today.

roamsr.getFuckingDate("02-19-2021")
# Thu Feb 18 2021 19:00:00 GMT-0500 (Eastern Standard Time)

The pull request incorporates a quick fix that I found to correct this (see the second answer):

https://stackoverflow.com/questions/439630/create-a-date-with-a-set-timezone-without-using-a-string-representation/439871#439871

aidam38 commented 3 years ago

Hey, thanks so much! :D I didn't expect anyone to notice my aggressive naming "getFuckingDate" so quickly, I must say this PR amused. I was so upset about the Firefox vs. Chrome bug...

Anyway, merging your fix, thanks again!

aidam38 commented 3 years ago

Oh, I should make this clear somewhere, but it'd probably be better to make pull requests to the dev branch, rather than master...