-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OJS] Submissions page: date of last activity doesn't follow configured date format #5517
Comments
True in OJS 3.1.2.4 |
This is because the date transformation happens in the browser so we rely on a JavaScript transformation. The data comes from the API, which returns our standard machine-readable date format (YYYY-MM-DD). See: https://github.com/pkp/ui-library/blob/master/src/mixins/global.js#L98-L127 We use toLocaleDateString to format the date based on the browser's locale. It would be nice to figure out a way to draw on the config option in the browser, but when the feature went in it was too late in the 3.1.x cycle to investigate thoroughly. Unfortunately, for this reason, it's probably a bit too difficult for the "Try Me" label. I'd be eager to hear ideas anyone has on how to align formatting between PHP and JavaScript. |
We're using |
🎉 This should be easy to do for 3.2. |
Having looked at this briefly, I think the barrier we face is in the translation. The I think we'll need to consider either asking our own translators to contribute the necessary strings:
Or consider returning localized dates alongside machine-readable dates in the API response. I'm going to bump this to 3.2.1 but let me know if you can think of any short-term improvement that we could do in time for 3.2. |
Yuck, I had assumed that the implementation would rely on |
I hope it's not irrelevant to add this here (as this is not tied specificaly to the Last activity recorded date issue) but I wanted to say, in my opinion, that the displays for the date formats used across the application should always be language specific. Actually it's not the case as the date formats defined in config.inc.php apply uniformly to all locales. I managed to find a way to accomodate our bilingual environments (French and English) by adopting an accepted bilingual way for us, that is to say :
7 February 2016 (Consequently, I didn't keep the default U.S. kind of way to write the date (months first : February 10) eventhough I would have preferred this last syntax) But this isn't always possible (depending on the combination of languages you are dealing with) and I would have preferred to use differents formats following the locale used. Does that make sense? |
Intl.RelativeTimeFormat is a new JavaScript object that may help us with the |
On the Submissions page, the date shown alongside "Last activity recorded" does not follow the date format defined in config.inc.php. It displays at yyyy/mm/dd regardless of the latter.
The text was updated successfully, but these errors were encountered: