Skip to content

Compare date according to client's timezone #10

@junjiah

Description

@junjiah

Currently when checking whether a tracking catalog is done for that day, timestamp is converted as Heroku's timezone (UTC). Needs to take client time zone into consideration.

now := time.Now()
y1, m1, d1 := now.Date()
y2, m2, d2 := markedAt.Date()
if y1 == y2 && m1 == m2 && d1 == d2 {
    // Already finished for today.
    catalog.Done = true
    catalog.Value = value
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions