logging current time with console.logs on frontend

This commit is contained in:
azivner
2017-12-18 22:06:24 -05:00
parent 1ebf9d4e56
commit 3edbb65b0f
4 changed files with 19 additions and 11 deletions

View File

@@ -5,7 +5,7 @@ function reloadApp() {
}
function showMessage(message) {
console.log("message: ", message);
console.log(now(), "message: ", message);
$.notify({
// options
@@ -18,7 +18,7 @@ function showMessage(message) {
}
function showError(message, delay = 10000) {
console.log("error: ", message);
console.log(now(), "error: ", message);
$.notify({
// options
@@ -53,6 +53,10 @@ function formatTime(date) {
return padNum(date.getHours()) + ":" + padNum(date.getMinutes());
}
function formatTimeWithSeconds(date) {
return padNum(date.getHours()) + ":" + padNum(date.getMinutes()) + ":" + padNum(date.getSeconds());
}
function formatDate(date) {
return padNum(date.getDate()) + ". " + padNum(date.getMonth() + 1) + ". " + date.getFullYear();
}
@@ -61,6 +65,10 @@ function formatDateTime(date) {
return formatDate(date) + " " + formatTime(date);
}
function now() {
return formatTimeWithSeconds(new Date());
}
function isElectron() {
return window && window.process && window.process.type;
}