-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More date utilities in handlebar template and config file #152
Comments
For now I use this hack to make it works. #!/usr/bin/env bash
tomorrow=$(date -v+1d +%A-%B-%Y-%m-%d)
arr=(${tomorrow//-/ })
dayname=${arr[0]}
monthname=${arr[1]}
year=${arr[2]}
month=${arr[3]}
day=${arr[4]}
when="$year-$month-$day"
mkdir -p $BRAIN_DIR/plans/$year/$month
cd $BRAIN_DIR
zk new --no-input "plans" \
--extra dayname="$dayname",monthname="$monthname",when="$when",year="$year",month="$month",day="$day" [group.plans]
paths = [
"plans",
]
[group.plans.note]
# uncomment if zk supports {{date tomorrow}}
# filename = "{{date now '%Y'}}/{{date now '%m'}}/{{date now '%Y-%m-%d'}}"
filename = "{{extra.year}}/{{extra.month}}/{{extra.when}}"
extension = "md"
# template = "plan/default.md"
template = "plan/hacky.md" ---
title: Plan of {{ extra.dayname }}, {{ extra.monthname }} {{ extra.day }}, {{ extra.year }}
description: Plan of {{ extra.dayname }}, {{ extra.monthname }} {{ extra.day }}, {{ extra.year }}
slug: {{ extra.year }}/{{ extra.month }}/{{ extra.day }}
date: {{ extra.when }}
type: plan
keywords:
- plan
- plans
roles:
- super-admin
- admin
---
What will I do at {{ extra.dayname }}, {{ extra.monthname }} {{ extra.day }}, {{ extra.year }}? Results: ---
title: Plan of Tuesday, January 11, 2022
description: Plan of Tuesday, January 11, 2022
slug: 2022/01/11
date: 2022-01-11
type: plan
keywords:
- plan
- plans
roles:
- super-admin
- admin
---
What will I do at Tuesday, January 11, 2022? Feel free to close this! Thanks! |
I recently merged in It will replace the default value of $ zk new --date tomorrow Let me know if that solves your problem. |
Thank you that fixes the problem! However, I find 1 issue, so far. Let me know if I am wrong. ➜ brain plan --date tomorrow --dry-run
/Users/rayandrew/brain/plans/2022/01/2022-01-14.md
---
title: Plan of , ,
description: Plan of , ,
slug: //
date:
type: plan
keywords:
- plan
- plans
roles:
- super-admin
- admin
---
What will I do at , , ? It shows that I create Is the date utilities in Thanks! |
Ha I'll take a look, which timezone are you in? In the meantime, you should be able to pass a RFC 3339 date as: $ zk new --date `date -v+1d +...` |
Hi, I am in Central Standard Time.
Yes this code works flawlessly! |
@RayAndrews Would you mind testing |
Yes! This is the result:
it worked flawlessly! However there is one bug: It seems passing full RFC 3339 date will throw error.
|
Right, Go supports by default only the full RFC 3339 template including the timezone. I added a few more formats: It's merged in |
I have tested and it works well for RFC3339 full timestamp now! Thank you @mickael-menu!! |
Hi!
Thank you for this application! It really helps me maintain my second brain.
However, I have specific use cases such as daily planning.
I usually create a plan for tomorrow in the night.
I think it would be good if this application has
{{ date tomorrow (format) }}
.Or is there any other way to get the tomorrow date?
Thank you again!
The text was updated successfully, but these errors were encountered: