mirror of
https://github.com/zadam/trilium.git
synced 2025-10-28 08:46:43 +01:00
logging current time with console.logs on frontend
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user