How to change the date format in summary emails?

I believe I have customized all text content elements containing dates but my summary emails don’t seem to be affected by that, they’re still going out with the “Month Day” format instead of “Day Month”. What am I missing? Where is the date format for digest emails set?

I think you want this:

https://github.com/discourse/discourse/blob/master/app/views/email/_post.html.erb#L18

But I’m not 100% sure that it used for digests.

https://github.com/discourse/discourse/blob/7eb5f783438bc0ea86fe22ffe6f2bb6c7d369d73/app/views/user_notifications/digest.html.erb#L115

Which is defined in

https://github.com/discourse/discourse/blob/0dee603ffca1c733e9fdcfcb18a45471e09d4872/app/mailers/user_notifications.rb#L132-L138

Which means you’ll have to change the short_no_year strings to change the date format in digests.

2 Likes

Wow, thanks a lot! I missed that one because it doesn’t include “date” as a string. Are there any other “hidden” date or time format fields?

I think most of them are here.

1 Like

Indeed, I found two more. But if those that you are linking to are “most of them” why is the list of date fields in admin/site-settings/customize/site_texts so much longer?Felt like dozens, but at least 20, I’d say.

The others are the ones provided by rails or used in the web app (those starting with js.).

2 Likes