-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fix different displayed date #315
Conversation
@Xpirix, thanks for looking at the issue! It is not clear to me why the "Created on" column displays "Nov 30, 2023" while the plugin has been created on "Nov 28, 2023". |
@agiudiceandrea , Thanks for your feedback. Indeed, the plugin was uploaded on different dates in my development environment but I did not update all screenshots. Please find below the updated screenshots for all of these pages for a newly uploaded plugin: |
@dimasciput Thank you. |
I can confirm the issue. // Replace the date with local timezone
$(".user-timezone").each(function (i) {
let localDate = toUserTimeZone($(this).text());
$(this).text(localDate);
})
function toUserTimeZone(date) {
try {
date = new Date(date);
let options = {
year: 'numeric', month: 'short', day: 'numeric',
hour: '2-digit', minute: '2-digit',
timeZoneName: 'short'
}
return date.toLocaleDateString([], options);
} catch (e) {
return date;
}
} The response headers report: Maybe a cloudflare cache issue? |
The issue has been fixed with #335. |
This fix is for the following issue:
In the current PR, all dates in the plugin list, the plugin details and the plugin version details use the same timezone provided by the filter
local_timezone
.In the plugin list, the date without time format is kept. A distance formatting (time since) using
moment.min.js
is used when it doesn't exceed one day.Please find below the screenshots for these 3 pages: