Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #6560 from marshall/lastUpdated

Bug 809974: Display "Last Updated" date and time in Device Info. r=evelyn
  • Loading branch information...
commit 46baef6a4277dd52fd9e37b018bbc2af7e6e3de5 2 parents 8302686 + e78b094
@fabi1cazenave fabi1cazenave authored
Showing with 26 additions and 2 deletions.
  1. +2 −2 apps/settings/index.html
  2. +24 −0 apps/settings/js/settings.js
View
4 apps/settings/index.html
@@ -1920,8 +1920,8 @@ <h1 data-l10n-id="deviceInfo"> Device Information </h1>
<a id="os-version" data-l10n-id="software"> Software </a>
</li>
<li>
- <small data-name="deviceinfo.last_updated"></small>
- <a id="last-update-date" data-l10n-id="last-updated"> Last Updated </a>
+ <small id="last-update-date"></small>
+ <a data-l10n-id="last-updated"> Last Updated </a>
</li>
<li>
<label>
View
24 apps/settings/js/settings.js
@@ -339,6 +339,29 @@ var Settings = {
req.send();
},
+ loadLastUpdated: function settings_loadLastUpdated() {
+ var settings = this.mozSettings;
+ if (!settings) {
+ return;
+ }
+
+ var lastUpdateDate = document.getElementById('last-update-date');
+ var lock = settings.createLock();
+ var key = 'deviceinfo.last_updated';
+ var request = lock.get(key);
+ request.onsuccess = function() {
+ var lastUpdated = request.result[key];
+ if (!lastUpdated) {
+ return;
+ }
+
+ var f = new navigator.mozL10n.DateTimeFormat();
+ var _ = navigator.mozL10n.get;
+ lastUpdateDate.textContent = f.localeFormat(new Date(lastUpdated),
+ _('shortDateTimeFormat'));
+ };
+ },
+
openDialog: function settings_openDialog(dialogID) {
var settings = this.mozSettings;
var dialog = document.getElementById(dialogID);
@@ -627,6 +650,7 @@ window.addEventListener('load', function loadSettings() {
document.getElementById('ftuLauncher').onclick =
Settings.launchFTU.bind(Settings);
Settings.loadGaiaCommit();
+ Settings.loadLastUpdated();
break;
case 'help': // handle specific link
Settings.getUserGuide(function userGuideCallback(url) {
Please sign in to comment.
Something went wrong with that request. Please try again.