Page 1 of 1
Date localization in popup caption
Posted: 11 Feb 2019, 11:15
by softcat
Hello,
I'm very impressed with the X3 phto gallery and have been customizing it for my needs for some time now.
As I'm running my gallery in german I found one tiny problem:
Is there a way to customize the formatting (and therefore the language) of the date caption in the image popup?
Changing the Date Format in Advanced -> Date Format does not seems to affect this.
Many thanks!
Re: Date localization in popup caption
Posted: 12 Feb 2019, 01:23
by mjau-mjau
Some observations about the DATE that shows in the POPUP:
- It doesn't currently support "timeago", which is a javascript implementation that makes the date relative "Two years ago ..." etc. I'm a bit hesitant to add "timeago" to the date in the popup, because it seems more practical to display the actual date here.
- It does actually support the date format in advanced > date format, but if you have the format set to "timeago", it will revert to default "Day Month Year" (as in your screenshot).
- You are right that the date always formats to English, because that's how the default PHP date formatting works. However, I think this can be fixed to format the date based on your server's locale with strftime(), if your server has a valid timezone setting.
I'm open to suggestions ...
Re: Date localization in popup caption
Posted: 14 Feb 2019, 05:25
by mjau-mjau
For next release X3.28.0, we will implement
moment.js, which will handle all date formatting in multiple languages.
Re: Date localization in popup caption
Posted: 14 Feb 2019, 08:38
by softcat
Hello,
I agree that the date field in the popup should not show the "timeago" formatting, the actual date seems more reasonable.
Many thanks, it that sounds wonderful implenting moment.js, I looking forward the next release.