omnivore-app / obsidian-omnivore

Obsidian plugin to fetch articles and highlights from Omnivore
MIT License
757 stars 41 forks source link

[FR] Can't change the date archived format #80

Open mathisgauthey opened 1 year ago

mathisgauthey commented 1 year ago

I like to have a timeline of things. Hence I organised my YAML with these dates :

state: ARCHIVED
date_published: 2020-01-12 14:30:44
date_saved: 2023-06-07 08:29:42
date_read: 2023-06-07 08:53:33
date_archived: 2023-06-07T07:53:28.396Z

The issue is that there is no way to change the archived date format as of today.

Thanks in advance !

sywhb commented 8 months ago

Hey @mathisgauthey, you could use this function formatDate in the front matter template to format archived date.

For example: Template:

state: {{{ state }}}
date_published: {{{ datePublished }}}
date_saved: {{{ dateSaved }}}
date_read: {{{ dateRead }}}
date_archived: {{#formatDate}}{{{ dateArchived }}},"yyyy-MM-dd HH:mm:ss"{{/formatDate}}

Screenshots:

Screenshot 2023-11-15 at 10 50 56 AM Screenshot 2023-11-15 at 10 51 59 AM
mathisgauthey commented 8 months ago

Hey @mathisgauthey, you could use this function formatDate in the front matter template to format archived date.

For example: Template:

state: {{{ state }}}
date_published: {{{ datePublished }}}
date_saved: {{{ dateSaved }}}
date_read: {{{ dateRead }}}
date_archived: {{#formatDate}}{{{ dateArchived }}},"yyyy-MM-dd HH:mm:ss"{{/formatDate}}

Screenshots: Screenshot 2023-11-15 at 10 50 56 AM

Screenshot 2023-11-15 at 10 51 59 AM

Hey there, after updating omnivore plugin, your solution works ! I'll use that. Thanks a lot o/

I keep the feature request open so that an option is added for non tech users.