1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-04-23 03:03:13 +00:00

Add Cmd+' shortcut for local time and change the format of time

This commit is contained in:
Timur Ismagilov 2024-06-29 18:21:31 +03:00
parent 522640f8df
commit 922181ee93
2 changed files with 3 additions and 2 deletions

View File

@ -330,6 +330,7 @@ if (document.body.dataset.rrhAddr.startsWith('/edit')) {
new Shortcut(isMac ? 'Meta+k' : 'Ctrl+k', wrapLink, 'Inline link', { force: true }),
// Apparently, ⌘; conflicts with a Safari's hotkey. Whatever.
new Shortcut(isMac ? 'Meta+;' : 'Ctrl+;', insertDateUTC, 'Insert date UTC', { force: true }),
new Shortcut(isMac ? "Meta+'" : "Ctrl+'", insertTimeLocal, 'Insert local time', { force: true })
]))
}
}

View File

@ -93,7 +93,7 @@ function insertDateUTC() {
}
function insertTimeUTC() {
let time = new Date().toISOString().substring(11, 19) + " UTC"
let time = new Date().toISOString().substring(11, 16) + " UTC "
textInserter(time)()
}
@ -108,7 +108,7 @@ function insertDateLocal() {
function insertTimeLocal() {
let d = new Date()
textInserter(`${len2(d.getHours())}:${len2(d.getMinutes())}:${len2(d.getSeconds())}`)()
textInserter(`${len2(d.getHours())}:${len2(d.getMinutes())} `)()
}
function insertUserlink() {