Bug 1338083 - Restore full year in Library date columns. r=jfkthame draft
authorMarco Bonardo <mbonardo@mozilla.com>
Thu, 09 Feb 2017 10:38:51 +0100
changeset 481119 61510a9b0b661ca18046049480f386c51f58b444
parent 479417 7f1b358fb17dfd982c5e18c34d5735cd481c7f7c
child 545119 53a3eb97b1505eab64db57d9ef39c3a1f5753768
push id44728
push usermak77@bonardo.net
push dateThu, 09 Feb 2017 09:40:26 +0000
reviewersjfkthame
bugs1338083
milestone54.0a1
Bug 1338083 - Restore full year in Library date columns. r=jfkthame MozReview-Commit-ID: GIp7xzdAC9C
browser/components/places/content/treeView.js
browser/components/places/tests/chrome/test_treeview_date.xul
--- 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.