You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
wow-app/js/Utils.js

51 lines
1.5 KiB

/**
* Formats a date.
* @param {date} date - toggle decorations
* @param {params} params -
*/
function formatDate( date, params ) {
var options = {
weekday: "short",
year: "numeric",
month: "long",
day: "numeric",
hour: "2-digit",
minute: "2-digit",
timeZone: "UTC",
timeZoneName: "short",
};
options = [options, params].reduce(function (r, o) {
Object.keys(o).forEach(function (k) { r[k] = o[k]; });
return r;
}, {});
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString
return new Date( date ).toLocaleString( 'en-US', options );
}
function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}
function showSeedPage() {
// Shows `Settings->Seed & keys`. Prompts a password dialog.
passwordDialog.onAcceptedCallback = function() {
if(walletPassword === passwordDialog.password){
if(currentWallet.seedLanguage == "") {
console.log("No seed language set. Using English as default");
currentWallet.setSeedLanguage("English");
}
// Load keys page
appWindow.showPageRequest("Keys");
} else {
passwordDialog.showError(qsTr("Wrong password"));
}
}
passwordDialog.onRejectedCallback = function() {
leftPanel.selectItem(middlePanel.state);
}
passwordDialog.open();
if(isMobile) hideMenu();
updateBalance();
}