basic recent changes implementation

This commit is contained in:
azivner
2017-09-26 23:23:03 -04:00
parent c6472a1c0c
commit b30bc19bd2
6 changed files with 88 additions and 7 deletions

View File

@@ -15,16 +15,22 @@ $(document).bind('keydown', 'alt+s', function() {
$("input[name=search]").focus();
});
function formatTime(date) {
return (date.getHours() <= 9 ? "0" : "") + date.getHours() + ":" + (date.getMinutes() <= 9 ? "0" : "") + date.getMinutes();
}
function formatDate(date) {
const dateString = date.getDate() + ". " + (date.getMonth() + 1) + ". " + date.getFullYear() + " " +
date.getHours() + ":" + (date.getMinutes() <= 9 ? "0": "") + date.getMinutes();
return dateString;
return date.getDate() + ". " + (date.getMonth() + 1) + ". " + date.getFullYear();
}
function formatDateTime(date) {
return formatDate(date) + " " + formatTime(date);
}
// hide (toggle) everything except for the note content for distraction free writing
$(document).bind('keydown', 'alt+t', function() {
const date = new Date();
const dateString = formatDate(date);
const dateString = formatDateTime(date);
$('#noteDetail').summernote('insertText', dateString);
});