Skip to content

Week endpoint sometimes uses local time #284

@laggycomputer

Description

@laggycomputer

The week endpoint should, while it briefly deals with dates, always work in a defined timezone to avoid portability issues.
However it briefly dips into local time in one or more areas.
In particular, this issue is likely to lead to inconsistency between local testing (often carried out in Irvine time) and the cloud (cloud servers, regardless of location, often set UTC).

The timezone used instead should probably be America/Los_Angeles, the timezone applied to UCI, because:

  • Local time is used when extracting year, month, and date from "today", i.e. a default-constructed Date.
  • The use case for this is a user who is opening e.g. PeterPortal, who is expecting to see a week number corresponding to right now in UCI's time.
  • The only other fixed timezone that might make sense is UTC, but we're not interested in what week number it would be if UCI was located in a hypothetical place where the local time is UTC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first taskGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions