Add Date shortcut ISO 8601 format as an option in preference#3094
Add Date shortcut ISO 8601 format as an option in preference#3094lockee14 wants to merge 7 commits intoBoostIO:masterfrom
Conversation
browser/main/lib/ConfigManager.js
Outdated
| defaultNote: 'ALWAYS_ASK', // 'ALWAYS_ASK', 'SNIPPET_NOTE', 'MARKDOWN_NOTE' | ||
| showMenuBar: false | ||
| showMenuBar: false, | ||
| dateFormatISO8601: false |
There was a problem hiding this comment.
Shouldn’t it be editor instead of ui?
| : null | ||
| } | ||
|
|
||
| <div styleName='group-checkBoxSection'> |
There was a problem hiding this comment.
I think you should move this config down to editor setting
There was a problem hiding this comment.
as you asked me I put the config in the editor setting
| : null | ||
| } | ||
|
|
||
| {/* <div styleName='group-checkBoxSection'> |
There was a problem hiding this comment.
Please remove the code instead of just comment it out. Thank you 👍
| saveTagsAlphabetically: this.refs.saveTagsAlphabetically.checked, | ||
| enableLiveNoteCounts: this.refs.enableLiveNoteCounts.checked, | ||
| showMenuBar: this.refs.showMenuBar.checked, | ||
| // dateFormatISO8601: this.refs.dateFormatISO8601.checked, |
There was a problem hiding this comment.
Please remove the code instead of just comment it out. Thank you 👍
browser/main/lib/ConfigManager.js
Outdated
| disableDirectWrite: false, | ||
| defaultNote: 'ALWAYS_ASK', // 'ALWAYS_ASK', 'SNIPPET_NOTE', 'MARKDOWN_NOTE' | ||
| showMenuBar: false | ||
| // dateFormatISO8601: false |
There was a problem hiding this comment.
Please remove the code instead of just comment it out. Thank you 👍
browser/components/MarkdownEditor.js
Outdated
| switchPreview={config.editor.switchPreview} | ||
| enableMarkdownLint={config.editor.enableMarkdownLint} | ||
| customMarkdownLintConfig={config.editor.customMarkdownLintConfig} | ||
| // dateISO8601={config.ui.dateFormatISO8601} |
There was a problem hiding this comment.
Please remove the code instead of just comment it out. Thank you 👍
| switchPreview={config.editor.switchPreview} | ||
| enableMarkdownLint={config.editor.enableMarkdownLint} | ||
| customMarkdownLintConfig={config.editor.customMarkdownLintConfig} | ||
| // dateISO8601={config.ui.dateFormatISO8601} |
There was a problem hiding this comment.
Please remove the code instead of just comment it out. Thank you 👍
| enableSmartPaste={config.editor.enableSmartPaste} | ||
| hotkey={config.hotkey} | ||
| autoDetect={autoDetect} | ||
| // dateISO8601={config.ui.dateFormatISO8601} |
There was a problem hiding this comment.
Please remove the code instead of just comment it out. Thank you 👍
There was a problem hiding this comment.
I'm sorry I forgot to remove those before committing, it's done.
|
@lockee14 can you fix the conflict before I approve your code please? |
|
done |
|
@lockee14 It seems 1 check has failed. Could you look into this and fix it? |
missing indentation and brace between line 229 - 234:
before:
'Shift-Cmd-/': function (cm) {
if (global.process.platform !== 'darwin') { return }
[translateHotkey(hotkey.insertDateTime)]: function (cm) {
const dateNow = new Date()
cm.replaceSelection(dateNow.toLocaleString())
},
after:
'Shift-Cmd-/': function (cm) {
if (global.process.platform !== 'darwin') { return }
[translateHotkey(hotkey.insertDateTime)]: function (cm) {
const dateNow = new Date()
cm.replaceSelection(dateNow.toLocaleString())
}
},
|
Maybe it's because of this rule? This is so strange, it haven't happen before. I'll investigate it when I'm at home |
|
by looking at it a second time I think I get it, the code should be: translateHotkey seems to be here to handle compatibility issue between mac/linux/windows for the 'cmd' key thus: I think it should solve the issue but I'd like a second look on it since I'm not familiar with the codebase |
| cm.replaceSelection(dateNow.toLocaleDateString()) | ||
| } | ||
| }, | ||
| 'Cmd-/': function (cm) { |
There was a problem hiding this comment.
I think you should remove the code for Cmd-/ and Shift-Ctrl-/ and replace that with [translateHotkey(hotkey.insertDateTime)]. You code should be something like this:
[translateHotkey(hotkey.insertDateTime)]: function (cm) {
const dateNow = new Date()
if (self.props.dateFormatISO8601) {
cm.replaceSelection(dateNow.toISOString())
} else {
cm.replaceSelection(dateNow.toLocaleString())
}
}|
@lockee14 ping! |
|
@lockee14 ping 2 |
|
ping3 @lockee14 if you not interested in this PR anymore I'll take over it after a week 👍 |
|
Sorry for not answering I'm too busy with other things and I don't remember what I did, it was a long time ago... |
|
That's alright, I'll take it over and finish it for you:) Unless u are interested in finish it yourself |
|
Take over here #3600 |

Description
Feature: #3064
Add an option in preference > interface to toggle the iso 8601 format for the Date shortcut using ctrl-/ and ctrl-shift-/
Issue fixed
Type of changes
Checklist:
IssueHunt Summary
IssueHunt has been backed by the following sponsors. Become a sponsor