Fix explicit date format strings.

pull/763/head
Fredrik Jönsson 2015-02-11 13:36:09 +01:00
parent 0b4e584533
commit d774cfeb6d
3 changed files with 17 additions and 23 deletions

View File

@ -179,52 +179,42 @@ var ApprovedSiteView = Backbone.View.extend({
var accessDate = this.model.get("accessDate"); var accessDate = this.model.get("accessDate");
var timeoutDate = this.model.get("timeoutDate"); var timeoutDate = this.model.get("timeoutDate");
var displayCreationDate = "Unknown"; var displayCreationDate = $.t('grant.grant-table.unknown');
var hoverCreationDate = ""; var hoverCreationDate = "";
if (creationDate == null || !moment(creationDate).isValid()) { if ((creationDate != null) && moment(creationDate).isValid()) {
displayCreationDate = "Unknown";
hoverCreationDate = "";
} else {
creationDate = moment(creationDate); creationDate = moment(creationDate);
if (moment().diff(creationDate, 'months') < 6) { if (moment().diff(creationDate, 'months') < 6) {
displayCreationDate = creationDate.fromNow(); displayCreationDate = creationDate.fromNow();
} else { } else {
displayCreationDate = creationDate.format("MMMM Do, YYYY"); displayCreationDate = creationDate.format("LL");
} }
hoverCreationDate = creationDate.format("MMMM Do, YYYY [at] h:mmA"); hoverCreationDate = creationDate.format("LLL");
} }
var displayAccessDate = "Unknown"; var displayAccessDate = $.t('grant.grant-table.unknown');
var hoverAccessDate = ""; var hoverAccessDate = "";
if (accessDate == null || !moment(accessDate).isValid()) { if ((accessDate != null) && moment(accessDate).isValid()) {
displayAccessDate = "Unknown";
hoverAccessDate = "";
} else {
accessDate = moment(accessDate); accessDate = moment(accessDate);
if (moment().diff(accessDate, 'months') < 6) { if (moment().diff(accessDate, 'months') < 6) {
displayAccessDate = accessDate.fromNow(); displayAccessDate = accessDate.fromNow();
} else { } else {
displayAccessDate = accessDate.format("MMMM Do, YYYY"); displayAccessDate = accessDate.format("LL");
} }
hoverAccessDate = accessDate.format("MMMM Do, YYYY [at] h:mmA"); hoverAccessDate = accessDate.format("LLL");
} }
var displayTimeoutDate = "Unknown"; var displayTimeoutDate = $.t('grant.grant-table.unknown');
var hoverTimeoutDate = ""; var hoverTimeoutDate = "";
if (timeoutDate == null) { if (timeoutDate == null) {
displayTimeoutDate = "Never"; displayTimeoutDate = $.t('grant.grant-table.never');
hoverTimeoutDate = ""; } else if(moment(timeoutDate).isValid()) {
} else if(!moment(timeoutDate).isValid()) {
displayTimeoutDate = "Unknown";
hoverTimeoutDate = "";
} else {
timeoutDate = moment(timeoutDate); timeoutDate = moment(timeoutDate);
if (moment().diff(timeoutDate, 'months') < 6) { if (moment().diff(timeoutDate, 'months') < 6) {
displayTimeoutDate = timeoutDate.fromNow(); displayTimeoutDate = timeoutDate.fromNow();
} else { } else {
displayTimeoutDate = timeoutDate.format("MMMM Do, YYYY"); displayTimeoutDate = timeoutDate.format("LL");
} }
hoverTimeoutDate = timeoutDate.format("MMMM Do, YYYY [at] h:mmA"); hoverTimeoutDate = timeoutDate.format("LLL");
} }

View File

@ -230,10 +230,12 @@
"dynamically-registered": "This client was dynamically registered", "dynamically-registered": "This client was dynamically registered",
"expires": "Expires:", "expires": "Expires:",
"last-accessed": "Last accessed:", "last-accessed": "Last accessed:",
"never": "Never",
"no-sites": "You have not approved any sites.", "no-sites": "You have not approved any sites.",
"no-whitelisted": "You have not accessed any whitelisted sites.", "no-whitelisted": "You have not accessed any whitelisted sites.",
"pre-approved": "These are sites that have been pre-approved by an administrator.", "pre-approved": "These are sites that have been pre-approved by an administrator.",
"text": "These are sites you have approved manually. If the same site asks for the same access in the future, it will be granted without prompting.", "text": "These are sites you have approved manually. If the same site asks for the same access in the future, it will be granted without prompting.",
"unknown": "Unknown",
"whitelist-note": "<b>NOTE:</b> If you revoke them here, they will automatically be re-approved on your next visit wthout prompting.", "whitelist-note": "<b>NOTE:</b> If you revoke them here, they will automatically be re-approved on your next visit wthout prompting.",
"whitelisted-site": "This site was whitelisted by an adminstrator", "whitelisted-site": "This site was whitelisted by an adminstrator",
"whitelisted-sites": "Whitelisted Sites" "whitelisted-sites": "Whitelisted Sites"

View File

@ -232,10 +232,12 @@
"authorized": "Auktoriserad:", "authorized": "Auktoriserad:",
"dynamically-registered": "Denna klient registrerades dynamiskt", "dynamically-registered": "Denna klient registrerades dynamiskt",
"last-accessed": "Senast använd:", "last-accessed": "Senast använd:",
"never": "Aldrig",
"no-sites": "Du har inte godkänt någon webbplats.", "no-sites": "Du har inte godkänt någon webbplats.",
"no-whitelisted": "Du har inte besökt några vitlistade webbplatser.", "no-whitelisted": "Du har inte besökt några vitlistade webbplatser.",
"pre-approved": "Detta är webbplatser som är godkända i förväg av en administratör.", "pre-approved": "Detta är webbplatser som är godkända i förväg av en administratör.",
"text": "Det här är webbplatser som du själv har godkänt. Om en av dessa webbplatser begär samma information igen blir det medgivet utan att du blir tillfrågad.", "text": "Det här är webbplatser som du själv har godkänt. Om en av dessa webbplatser begär samma information igen blir det medgivet utan att du blir tillfrågad.",
"unknown": "Okänt",
"whitelist-note": "<b>OBS:</b> Om du återkallar dem kommer de automatiskt att godkännas igen nästa gång du besöker dem utan att du blir tillfrågad.", "whitelist-note": "<b>OBS:</b> Om du återkallar dem kommer de automatiskt att godkännas igen nästa gång du besöker dem utan att du blir tillfrågad.",
"whitelisted-site": "Denna webbplats är vitlistad av en administratör", "whitelisted-site": "Denna webbplats är vitlistad av en administratör",
"whitelisted-sites": "Vitlistade webbplatser" "whitelisted-sites": "Vitlistade webbplatser"