blinry / habitctl

Minimalist command line tool you can use to track and examine your habits.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Timezone bug

wakatara opened this issue · comments

Hey there,

This one is interesting. I've been working around it the last few days simply by editing the log file in vim, but imagine it's an unintended consequence of the files having a timezone component.

I flew from Singapore to San Francisco this week and it's been messing up my dailies since I got here. =]

To reproduce:

  1. Create initial log and habits file in time zone like GMT +8
  2. Log some stuff
  3. Fly to GMT -7 (or change your system clock... =p )
  4. You will be prompted for days you have already created as the prompt will note :2019-04-12-07:00: or similar.

However, the next day, it will then ask you for the same information again (and write it).

Seems like a bug. I think the issue here is the timezone being asked for when I believe most people simply consider how they've tracked habits on the "subjective day"

lemme know if this is not clear. I imagine my system will simply fix itself when I fly back to SG< but it does seem like a crossing datelines bug.

ciao!

I fixed this one too. =] I've recoded all Date structs to use NaiveDate from the chrono crate and will put in (another) pull request.

Wow, Daryl, that's awesome! Thank you so much for your work on this! \o/ I'll find some time to review the PRs next year!

No worries, cheery picked the commits and put them in a branch and the pull request (plus updated crates) is at Pull request 23.

Merry XMas!