Added support for custom date formats

This commit is contained in:
Jon-William Lewis
2016-02-15 16:30:49 -06:00
parent 051546691f
commit 69bbd06948
3 changed files with 8 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ fi
# Write an ammendment header
if [ -z "$CREATE" ]; then
printf "\n %s\n" "edit - $(date)" >> "$TMP_NOTE"
printf "\n%s\n" "edit - $(date $DATE_FMT)" >> "$TMP_NOTE"
printf "%s\n" "===================================" >> "$TMP_NOTE"
fi

View File

@@ -11,7 +11,12 @@ EXT=note # File extension to use (for listing notes)
#EDITOR= # Preferred Editor:
# If you would like to specify a different editor for
# sns to use, you may do so here.
# sns to use, you may do so here, otherwise, sns will
# use the editor specified in the environment.
DATE_FMT="+%D %T" # Date Format:
# If you would like to modify the date format, you may
# specify one appropriate to the `date` command.
ENCRYPTION="FALSE" # Main Encryption Toggle:
# WARNING: ANY PREVIOUSLY UNENCRYPTED NOTES WILL BE LOST

View File

@@ -1,3 +1,3 @@
function p_header(){
printf "# %s\n## Date: %s\n" "$(basename ${NOTE%.*})" "$(date)"
printf "# %s\n## Date: %s\n" "$(basename ${NOTE%.*})" "$(date "$DATE_FMT")"
}