PKief / vscode-markdown-checkbox

Get it from the marketplace:
https://marketplace.visualstudio.com/items?itemName=PKief.markdown-checkbox
MIT License
34 stars 11 forks source link

Add timestamp if checkbox is created #17

Open fujohnwang opened 4 years ago

fujohnwang commented 4 years ago

complete action has a timestamp, but there is no timestamp when the checkbox is created.

if a create tmestamp is there , I can roughly know how long the TODO item take.

I am not a JS developer, so if this feature can be done, that will be great ;)

fujohnwang commented 4 years ago

I have add the following code to local copy to solve this issue by myself, thanks.

(new Date().toISOString().split('T')[0])+"-> "

fujohnwang commented 4 years ago

image

PKief commented 4 years ago

@fujohnwang thank you for letting me know that you've fixed the issue for yourself. Would you like to create a pull request with your changes? Then I could take a look and include it to this extension 🙂

I could also add an option which could enable/disable this feature through the user settings 👍

fujohnwang commented 4 years ago

@PKief sorry, I just modify the local source code under ~/.vscode, since I don't have enough skills on vscode extension dev, I have simply browsed the source and add date string under:

if(!r(s))e.edit(e=>{e.insert(new o.Position(s.lineNumber,a.pos),(t&&!a.bullet?n+" ":"")+"[ ] "+(new Date().toISOString().split('T')[0])+"-> ")})})

vscode-markdown-checkbox/src/createCheckbox.ts maybe.

I think, if you can provide config options for the date format and disable/enable, that will be great for all extension users ;0)