Home › Forums › Calendar Products › Events Calendar PRO › Date format in this week widget
- This topic has 10 replies, 2 voices, and was last updated 8 years, 9 months ago by
Jonas Lindén.
-
AuthorPosts
-
July 3, 2017 at 5:48 am #1315451
Jonas Lindén
ParticipantThis week widget is showing events with: day of the week + date.
However the date is formatted in english. So for me it’s showing Day of the week in Swedish but it’s then showing the date as 3rd, 4th etc. instead of translating this to the swedish version for every version is it possible to change format to (F j)?
So it would just show Month and a number.July 4, 2017 at 11:23 am #1316000Barry
MemberHi Jonas,
Thanks for highlighting this: the dates are not currently translated (but of course they should be) – in fact, I’m surprised the days show correctly for you.
We do have hooks to modify them, though, and if you want to alter the date format you could use something like this (and add it to your theme’s functions.php file or to a custom plugin):
add_filter( 'tribe_events_this_week_date_format', function() { return 'F j'; } );Does that help in the interim?
July 4, 2017 at 11:25 am #1316001Barry
MemberHi again Jonas,
On further review, I’m mistaken: we do pass the dates through WordPress’s internationally-friendly date formatting function. With that in mind, is it possible the core WP translation for Swedish is lacking some translations?
July 6, 2017 at 1:17 am #1316704Jonas Lindén
ParticipantHello,
As far as I can see everything else is working ok in the Swedish version of WordPress.
I’ve even tried changing the date format in wordpress but it doesn’t affect the event list.
Med vänlig hälsning
July 6, 2017 at 11:42 am #1317038Barry
MemberInteresting. Here’s what I see if I switch my site to use Swedish (se_SV) in respect of the This Week widget:

So far as I can see, the day names are translated as expected. Am I misunderstanding the problem in some way, perhaps? Or do you have any language-specific plugins (such as WPML) or anything comparable where the configuration may be getting in the way of normal operation?
July 10, 2017 at 7:31 am #1318381Jonas Lindén
ParticipantHello, your picture shows my problem perfectly.
The day of the week is in the correct language but not the date.
1st, 2nd, 3rd is
1:a, 2:a, 3:e in Swedish. But it would be ok to just switch it to a simple date as in 1, 2, 3 etc.
Or 2017-07-10 or 170710.July 10, 2017 at 3:25 pm #1318660Barry
MemberGotcha! Those are actually passed through WordPress’s own date localization helpers, so my hunch is the problem lies there rather than directly with our own plugin code.
Did you have a chance to try to approach I suggested previously (with the tribe_events_this_week_date_format code)?
July 10, 2017 at 11:12 pm #1319343Jonas Lindén
ParticipantSorry Barry,
You wrote two posts and the second one started with “I was mistaken…” so I never read the first one =)
I added the changes to functions.php and that resolved my problem. Sorry for taking up more of your time and thanks for the help.July 11, 2017 at 7:02 am #1319478Barry
MemberNot at all – I should have been clearer – glad you’re sorted in any case 🙂
August 2, 2017 at 9:35 am #1329507Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Date format in this week widget’ is closed to new replies.
