Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make date/datetime types consistent #8

Open
marksteward opened this issue Feb 9, 2015 · 5 comments · May be fixed by #28
Open

Make date/datetime types consistent #8

marksteward opened this issue Feb 9, 2015 · 5 comments · May be fixed by #28

Comments

@marksteward
Copy link
Contributor

The algorithm generator creates PSEvents with date set to a datetime, while get_manual_ps_dates sets it to a date. Make these consistent and testable. Make sure overriding starts and ends in the json works too.

@jaylett
Copy link
Contributor

jaylett commented Feb 9, 2015

Should we also be ensuring we are TZ-aware throughout?

@marksteward
Copy link
Contributor Author

Yes, but I'd like some more tests before we start that :)

E.g. https://github.com/pubstandards/pubstandards-london/blob/master/tests/test_ps_data.py#L71

@Jonty
Copy link
Member

Jonty commented Feb 9, 2015

Argh, I wrote "timezones" on my notepad on the train and then forgot about it. Will do that tonight.

@marksteward
Copy link
Contributor Author

TZ-awareness is #9, which is probably best sorted out before addressing this, as it also should include tests for starts/ends override.

marksteward added a commit that referenced this issue Mar 27, 2016
Rework constructor of PSEvents so that it always take a date, and
the override attribute is accurate. This allows us to compare two
PSEvents for equality and use .override in templates.

Fixes #8, #15 and #22
@marksteward
Copy link
Contributor Author

PSEvent should now consistently have the following attributes:

.date is a datetime.date
.starts/ends are datetime.times
.start_dt/end_dt are aware datetime.datetimes

marksteward added a commit that referenced this issue Mar 27, 2016
Rework constructor of PSEvents so that it always take a date, and
the override attribute is accurate. This allows us to compare two
PSEvents for equality and use .override in templates.

Fixes #8, #15 and #22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants