Add Cmd+' shortcut for local time and change the format of time
This commit is contained in:
parent
522640f8df
commit
922181ee93
@ -330,6 +330,7 @@ if (document.body.dataset.rrhAddr.startsWith('/edit')) {
|
|||||||
new Shortcut(isMac ? 'Meta+k' : 'Ctrl+k', wrapLink, 'Inline link', { force: true }),
|
new Shortcut(isMac ? 'Meta+k' : 'Ctrl+k', wrapLink, 'Inline link', { force: true }),
|
||||||
// Apparently, ⌘; conflicts with a Safari's hotkey. Whatever.
|
// Apparently, ⌘; conflicts with a Safari's hotkey. Whatever.
|
||||||
new Shortcut(isMac ? 'Meta+;' : 'Ctrl+;', insertDateUTC, 'Insert date UTC', { force: true }),
|
new Shortcut(isMac ? 'Meta+;' : 'Ctrl+;', insertDateUTC, 'Insert date UTC', { force: true }),
|
||||||
|
new Shortcut(isMac ? "Meta+'" : "Ctrl+'", insertTimeLocal, 'Insert local time', { force: true })
|
||||||
]))
|
]))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -93,7 +93,7 @@ function insertDateUTC() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function insertTimeUTC() {
|
function insertTimeUTC() {
|
||||||
let time = new Date().toISOString().substring(11, 19) + " UTC"
|
let time = new Date().toISOString().substring(11, 16) + " UTC "
|
||||||
textInserter(time)()
|
textInserter(time)()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ function insertDateLocal() {
|
|||||||
|
|
||||||
function insertTimeLocal() {
|
function insertTimeLocal() {
|
||||||
let d = new Date()
|
let d = new Date()
|
||||||
textInserter(`${len2(d.getHours())}:${len2(d.getMinutes())}:${len2(d.getSeconds())}`)()
|
textInserter(`${len2(d.getHours())}:${len2(d.getMinutes())} `)()
|
||||||
}
|
}
|
||||||
|
|
||||||
function insertUserlink() {
|
function insertUserlink() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user