CyanVoxel / Obsidian-Vault-Template

A Template for my Obsidian Vault.
MIT License
240 stars 32 forks source link

Daily notes giving en error from Templater #3

Open zhampu opened 3 months ago

zhampu commented 3 months ago

AS said in the issue:

Im getting this message:

Templater Error: Invalid reference date format, try specifying one with the argument 'reference_format'

IngWonk commented 3 months ago

Edit (TEMPLATE) Daily file in 99 - Meta/00 - Templates:

---
date: <%tp.date.now("YYYY-MM-DD")%>T<%tp.date.now("HH:mm")%>
tags:
  - Daily
cssclasses:
  - daily
  <% "- " + tp.date.now("dddd").toLowerCase() %>
---
# DAILY NOTE
## <% tp.date.now("dddd, Do MMMM YYYY")%>
***
### Journal
#### TIME
Customize this template to your liking!
...
***
### Tasks
- [ ] Task 1
- [ ] Task 2
- [ ] Task 3
CyanVoxel commented 2 months ago

As stated on the main Daily Templates repo README (https://github.com/CyanVoxel/Obsidian-Daily-Themes): "The template references your note's filename for the date and expects a "YYYYMMDD" naming format."

If your filename doesn't match this format, then this is likely the issue you're running into. This was a change made in v1.0.2 CyanVoxel/Obsidian-Daily-Themes@51abd0d050e485af7861bf1bfb38eaefd19e9305 in order to allow for creating new notes for previous days with the correct date, instead of always using the current date.

If this is in fact the issue, you could either change your daily note naming format, change the template to match your format (Templater uses https://momentjs.com/ date formats), or you could grab the old template that uses the current date instead of extrapolating it from the filename: https://github.com/CyanVoxel/Obsidian-Daily-Themes/blob/bb1bc8866c18739c3b8a263986496c184a2666a5/(TEMPLATE)%20Daily.md?plain=1

Let me know if one or more of those options is sufficient!

Rodhor commented 2 months ago

I adjusted the daily notes css file to add opacity. In my case it was because I'm using Anupucin theme with a backgrund picture and translucent windows

.daily { --dark: var(--dark); color: var(--highlight); background-color: var(--dark); --text-normal: var(--highlight); --text-muted: var(--highlight); --text-faint: var(--highlight); --checklist-done-color: var(--highlight); --metadata-label-text-color: var(--highlight); --metadata-input-text-color: var(--highlight); --tag-color: var(--dark); --tag-background: var(--primary); --hr-color: var(--primary); --blockquote-border-color: var(--primary); --interactive-accent: var(--primary); --collapse-icon-color-collapsed: var(--primary); --checkbox-color: var(--primary); --checkbox-marker-color: var(--dark); --checkbox-color-hover: var(--highlight); --checkbox-border-color: var(--highlight); --list-marker-color: var(--highlight); --code-background: black; --code-normal: var(--primary);

--background-modifier-border-focus: var(--primary); --background-modifier-border: color-mix(in srgb, var(--highlight) 60%, transparent); --background-modifier-hover: color-mix(in srgb, var(--highlight) 60%, transparent); --pill-cover-hover: color-mix(in srgb, var(--highlight) 60%, transparent);

opacity: 0.6; }

Works suprisingly nice with the daily theme