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 formats more configurable #42

Open
philgyford opened this issue Oct 28, 2019 · 0 comments
Open

Make date formats more configurable #42

philgyford opened this issue Oct 28, 2019 · 0 comments
Assignees

Comments

@philgyford
Copy link
Owner

Stemming from philgyford/django-hines#205

Although we added the SPECTATOR_DATE_FORMAT setting, this isn't used when we're generating a span of dates for readings. e.g. "1 February 2017 to 2018", "1-6 February 2017" or "February to March 2018".

So I think we need a bunch of settings to be used by spectator.reading.templatetags.spectator_reading.reading_dates(). Initial guesses, with defaults:

SPECTATOR_DATE_FORMAT = "%-d %B %Y"  # "3 September 2017", already exists

SPECTATOR_DATE_FORMAT_MONTH_YEAR = "%B %Y"  # "September 2017"

SPECTATOR_DATE_FORMAT_DAY_MONTH = "%-d %B"  # "3 September"

SPECTATOR_DATE_FORMAT_YEAR = "%Y"  # "2017"

SPECTATOR_DATE_FORMAT_MONTH = "%B"  # "September"

SPECTATOR_DATE_FORMAT_DAY = "%-d"  # "3"

SPECTATOR_PERIOD_FORMAT_SHORT = "{}–{}"  # Like "3–5 September 2017"

SPECTATOR_PERIOD_FORMAT_LONG = "{} to {}"  # Like "3 September 2017 to 3 March 2018"

But... while I want to be able to make all day-specific periods for Hines like "2019-10-28", doing the above alone wouldn't let us generate links for each date to that day's page.

@philgyford philgyford self-assigned this Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant