ashnoa / dakoku

A CLI tool for your time management.
MIT License
4 stars 0 forks source link

`show` can't show correctly with timezone. #3

Closed ashnoa closed 4 years ago

ashnoa commented 4 years ago

as is:

When I use show subcommand at 2020-03-18T08:00+09:00, dakoku shows tasks from 2020-03-17T00:00+09:00.

Now, code is below in cmd/show.go:

until := time.Now().Add(time.Duration(1000000000 * 60 * 60 * 24 * o.days * -1)).Truncate(time.Hour * 24).Add(time.Duration(1000000000 * 60 * 60 * 9 * -1)).Format(time.RFC3339)

This bug happens because "Truncate" doesn't consider timezone.

to be:

dakoku shows tasks from 2020-03-18T00:00+09:00

environment:

(None)

to reproduce: environment

(None)

frequency: to reproduce

(None)