kbravh / tweet-to-markdown

A command line tool to convert Tweets to Markdown.
MIT License
159 stars 9 forks source link

Allow users to define date format #17

Open kbravh opened 1 year ago

kbravh commented 1 year ago

Currently, the date format is hardcoded for the frontmatter and the tweet text. Ideally, the user should be able to pass in a format string, such as LLL or YYYY-MM-DD.

Unfortunately, the built-in toLocaleDateString does not accept those format strings, and passing a JSON options object is unwieldy for a CLI. I'd switch to Day.js, but packaging all of the i18n languages in will make it much heavier than needed, when each user will probably only use one of those locales.