diff --git a/chezmoi/dot_zshrc.d/executable_notes.sh b/chezmoi/dot_zshrc.d/executable_notes.zsh similarity index 82% rename from chezmoi/dot_zshrc.d/executable_notes.sh rename to chezmoi/dot_zshrc.d/executable_notes.zsh index f3fde76..e4be69a 100644 --- a/chezmoi/dot_zshrc.d/executable_notes.sh +++ b/chezmoi/dot_zshrc.d/executable_notes.zsh @@ -43,7 +43,7 @@ notes() { 'commit') git add . - git commit -m "notes commit $(date)" + git commit -m "notes commit $(strftime '%a %d %b %Y %r %Z')" ;; 'push') @@ -79,13 +79,12 @@ notes() { ( set -euo pipefail - readonly NOW="$(date +%s)" - - readonly FILE_PATH="${NOTES_DIR}/$(date -d "@${NOW}" +'%Y/%m/%Y-%m-%d').md" + readonly NOW="$EPOCHSECONDS" + readonly FILE_PATH="${NOTES_DIR}/$(strftime '%Y/%m/%Y-%m-%d.md' "$NOW")" mkdir -p "$(dirname "${FILE_PATH}")" if ! [ -e "${FILE_PATH}" ]; then - echo -e "# $(date -d "@${NOW}" +'%a %d %b %Y')\n\n## todo\n\n" > "${FILE_PATH}" + echo -e "# $(strftime '%a %d %b %Y' "$NOW")\n\n## todo\n\n" > "${FILE_PATH}" fi "${EDITOR}" "${EDITOR_OPTIONS[@]}" "${FILE_PATH}"