Created
January 7, 2022 23:42
-
-
Save broskees/14881503fcbc0af5d388641b3e3bda83 to your computer and use it in GitHub Desktop.
Readwise to obsidian template - zettlekasten 12 digit id (based on date & time) (Jinja)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{date|date("Ymd")}}{% for char in time|replace(":", "")|replace("am", "")|replace("pm", "")|list %}{% if loop.index == 1 and time[1] == ":" and "am" in time %}0{{char}}{% elif loop.index < 3 and time[2] == ":" and time[1] == "2" and "am" in time %}0{% elif loop.index == 1 and time[1] == ":" and "pm" in time %}{{char|int() + 12}}{% elif loop.index < 3 and time[2] == ":" and "pm" in time %}{{char|int() + loop.index}}{% else %}{{char}}{% endif %}{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment