linuxsoftware / ls.joyous

A calendar application for Wagtail
BSD 3-Clause "New" or "Revised" License
74 stars 35 forks source link

custom formatting of dateFormat #17

Closed lucasrohlf closed 5 years ago

lucasrohlf commented 5 years ago

Is it possible to reformat the output of dateFormat(when) without editing telltime.py?

I have been trying via templatetags but I have had no luck so far.

linuxsoftware commented 5 years ago

No, sorry, in that old bit of code I was only thinking about my own preferences.

To fix this what do you think about having a couple of new settings JOYOUS_DATE_FORMAT and JOYOUS_TIME_FORMAT. If these are not set Joyous would default to using the standard Django formatting. They would have the same options as https://docs.djangoproject.com/en/dev/ref/templates/builtins/#std:templatefilter-date, but with an addition so that the year is not displayed if it is the current year (perhaps "[Y]").

Would that meet your needs?

linuxsoftware commented 5 years ago

New settings JOYOUS_DATE_FORMAT, JOYOUS_DATE_SHORT_FORMAT and JOYOUS_TIME_FORMAT now allow custom formatting of dateFormat, dateShortFormat (formerly known as dateFormatYMD) and timeFormat.