Bug 1338083 - Restore full year in Library date columns. r=jfkthame
MozReview-Commit-ID: GIp7xzdAC9C
--- a/browser/components/places/content/treeView.js
+++ b/browser/components/places/content/treeView.js
@@ -509,17 +509,17 @@ PlacesTreeView.prototype = {
},
__dateFormatter: null,
get _dateFormatter() {
if (!this.__dateFormatter) {
const locale = Cc["@mozilla.org/chrome/chrome-registry;1"]
.getService(Ci.nsIXULChromeRegistry)
.getSelectedLocale("global", true);
- const dtOptions = { year: "2-digit", month: "numeric", day: "numeric",
+ const dtOptions = { year: "numeric", month: "numeric", day: "numeric",
hour: "numeric", minute: "numeric" };
this.__dateFormatter = new Intl.DateTimeFormat(locale, dtOptions);
}
return this.__dateFormatter;
},
COLUMN_TYPE_UNKNOWN: 0,
COLUMN_TYPE_TITLE: 1,
--- a/browser/components/places/tests/chrome/test_treeview_date.xul
+++ b/browser/components/places/tests/chrome/test_treeview_date.xul
@@ -122,17 +122,17 @@
is(text, node.title, "Title is correct");
break;
case "url":
is(text, node.uri, "Uri is correct");
break;
case "date":
let timeObj = new Date(node.time / 1000);
// Default is short date format.
- let dtOptions = { year: '2-digit', month: 'numeric', day: 'numeric',
+ let dtOptions = { year: 'numeric', month: 'numeric', day: 'numeric',
hour: 'numeric', minute: 'numeric' };
// For today's visits we don't show date portion.
if (node.uri == "http://at.midnight.com/" ||
node.uri == "http://after.midnight.com/") {
dtOptions = { hour: 'numeric', minute: 'numeric' };
} else if (node.uri != "http://before.midnight.com/") {
// Avoid to test spurious uris, due to how the test works
// a redirecting uri could be put in the tree while we test.