Last active
July 22, 2020 02:15
-
-
Save pmbauer/9285d6a6c72fc86d9300f28042642ca6 to your computer and use it in GitHub Desktop.
roam weekly plan
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
#/usr/bin/env bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
roam_date() { | |
date -d "${*}" '+%B %eXX, %Y' \ | |
| sed -e 's/11XX/11th/; s/12XX/12th/; s/13XX/13th/' \ | |
-e 's/1XX/1st/; s/2XX/2nd/; s/3XX/3rd/' \ | |
-e 's/XX/th/; s/ / /' | |
} | |
ONE_DAY=$((60 * 60 * 24)) | |
week_start=$(date -d "${*:-next Monday}" "+%s") | |
cat <<END | |
Week:: [[$(roam_date @$((${week_start} + ${ONE_DAY} * 0)))]] | |
## Top Weekly Goals | |
## [[Weekly Habits]] | |
- | |
## Daily Goals | |
- Monday: [[$( roam_date @$((${week_start} + ${ONE_DAY} * 0)))]] | |
- Tuesday: [[$( roam_date @$((${week_start} + ${ONE_DAY} * 1)))]] | |
- Wednesday: [[$(roam_date @$((${week_start} + ${ONE_DAY} * 2)))]] | |
- Thursday: [[$( roam_date @$((${week_start} + ${ONE_DAY} * 3)))]] | |
- Friday: [[$( roam_date @$((${week_start} + ${ONE_DAY} * 4)))]] | |
- Saturday: [[$( roam_date @$((${week_start} + ${ONE_DAY} * 5)))]] | |
- Sunday: [[$( roam_date @$((${week_start} + ${ONE_DAY} * 6)))]] | |
END |
I tried this on Manjaro linux and when I type "roam_wp" afterwards the terminal closes on me. Any idea why?
Thanks
@Singularity9 nope
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If running on macOS you'll need to change from
date
togdate
and that got it working for me!Got super confused why you were passing a format to the daylight saving option '-d' then it clicked 😆 and I checked
which date
returns/bin/date
belonging to the system and isn't the gnu one.brew info coreutils
also mentions this: