Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1431)

Unified Diff: static/js/main/main.js

Issue 134403003: chromium-status: fix interpretation of week days when localizing timestamps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/chromium-status
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: static/js/main/main.js
diff --git a/static/js/main/main.js b/static/js/main/main.js
index 850d98d4b02b955ee8a69014c4c7d978b6329469..69a19f170893bbea5ce3536bca7661faca374544 100644
--- a/static/js/main/main.js
+++ b/static/js/main/main.js
@@ -41,7 +41,10 @@ function localize_times() {
return format(date, 'EEE, dd MMM', 'HH:mm');
}
- var tzname = locale.format(new Date(), {
+ var now = new Date();
+ var curr_year = now.getFullYear();
+
+ var tzname = locale.format(now, {
selector: 'time',
timePattern: 'z'
});
@@ -54,9 +57,13 @@ function localize_times() {
elements[i].innerText = long_date(elements[i].innerText);
// Convert all the fields that lack a timezone (which we know is UTC).
+ // We'll assume the timestamps represent the current year as it'll only
+ // really affect the short day-of-week name, and even then it'll only be
+ // slightly off during the ~1st week of January.
elements = document.getElementsByName('date.date');
for (i = 0; i < elements.length; ++i)
- elements[i].innerText = short_date(elements[i].innerText + ' UTC');
+ elements[i].innerText = short_date(elements[i].innerText + ' ' + curr_year
+ + ' UTC');
// Convert all the fields that are just a timezone.
elements = document.getElementsByName('date.tz');
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698