Skip to content

Template timezones are off by a day #305

@diveonebot

Description

@diveonebot

Describe the bug
I came here to search the issues for this exact problem. The date times in the templates are off by exactly 1 full day. I've got the Django settings properly configured to be timezone aware. The best hypothesis I had matches comments in #172 about how momentjs interprets days and Python interpret days. This would make sense (0 == Sunday in moment, 0== Monday in Python -- a full day).

In the event this is happening only in DST areas, the timezone Ive tested it for is America/Los_Angeles

Im running the app in a vanilla Django setup, with the only thing installed is django-appointment. So It should be easily replicable for anyone who installs it.

To Reproduce
Steps to reproduce the behavior:

  1. Create an empty django project.
  2. Settings :TIME_ZONE = 'America/Los_Angeles' USE_I18N = True USE_L10N = True USE_TZ = True
  3. Install this package using the instructions provided.
  4. Open the appointments/request/1 page.

Expected behavior
Setting a persons schedule to Sunday and Friday should not appear as Monday and Saturday.

Screenshots
Edit to add screenshot of something interesting I just found while debugging the issue:

Image

Desktop (please complete the following information):

  • OS: mac
  • Browser firefox

Additional context
I believe its related to one of the problems reported in issue #172

Possible Solution

If you have an idea about what is causing this issue or how to fix it, please let us know.

Can you fix the bug?

  • Yes, I can fix the bug and will open a pull request.
  • No, I can't fix the bug, but I can assist in testing and providing feedback.
  • No, I can't fix the bug, but I can provide more information to help you fix it.
  • No, I can't fix the bug, but I can open an issue to report it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions