FEATURE: allow customizing default timezone for email. (#32964)

1. Changes default email format to llll (eg: Tue, May 8, 2018 2:00 AM)
from 2018-05-08T00:00:00Z UTC which is not nice on the eyes
2. Adds `discourse_local_dates_email_timezone` which allows configuring
default timezone in emails
3. Improved help text on site settings (format / timezone)

---------

Co-authored-by: Gary Pendergast <gary@pento.net>
This commit is contained in:
Sam
2025-05-29 14:17:37 +10:00
committed by GitHub
parent 0142d352a8
commit 2261d3711b
6 changed files with 58 additions and 5 deletions

View File

@ -3,4 +3,5 @@ en:
discourse_local_dates_enabled: "Enable the discourse-local-dates feature. This will add support to local timezone aware dates in posts using the [date] element"
discourse_local_dates_default_formats: "Frequently used date time formats, see: <a target='_blank' rel='noopener' href='https://momentjs.com/docs/#/parsing/string-format/'>momentjs string format</a>"
discourse_local_dates_default_timezones: "Default list of timezones, must be a valid <a target='_blank' rel='noopener' href='https://en.wikipedia.org/wiki/List_of_tz_database_time_zones'>TZ</a>"
discourse_local_dates_email_format: "Format used to display a date in emails"
discourse_local_dates_email_format: "Format used to display a date in emails, examples: 'LLLL', 'llll' or 'YYYY-MM-DDTHH:mm:ss[Z]'. see: <a target='_blank' rel='noopener' href='https://momentjs.com/docs/#/parsing/string-format/'>momentjs string format</a>"
discourse_local_dates_email_timezone: "Timezone used to display dates in emails, must be a valid <a target='_blank' rel='noopener' href='https://en.wikipedia.org/wiki/List_of_tz_database_time_zones'>TZ</a>"

View File

@ -1,6 +1,10 @@
plugins:
discourse_local_dates_email_timezone:
default: "Etc/UTC"
client: true
area: "localization"
discourse_local_dates_email_format:
default: "YYYY-MM-DDTHH:mm:ss[Z]"
default: "llll z"
client: true
discourse_local_dates_enabled:
default: true