From 69bbd0694826d909503f29a5c207c1466facee77 Mon Sep 17 00:00:00 2001 From: Jon-William Lewis Date: Mon, 15 Feb 2016 16:30:49 -0600 Subject: [PATCH] Added support for custom date formats --- src/includes/edit.sns.sh | 2 +- src/includes/init_store.sns.sh | 7 ++++++- src/includes/p_header.sh | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/includes/edit.sns.sh b/src/includes/edit.sns.sh index 2953e5e..f2e88f7 100644 --- a/src/includes/edit.sns.sh +++ b/src/includes/edit.sns.sh @@ -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 diff --git a/src/includes/init_store.sns.sh b/src/includes/init_store.sns.sh index 9a2c20d..40552b7 100644 --- a/src/includes/init_store.sns.sh +++ b/src/includes/init_store.sns.sh @@ -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 diff --git a/src/includes/p_header.sh b/src/includes/p_header.sh index b42dfd6..65a1abf 100644 --- a/src/includes/p_header.sh +++ b/src/includes/p_header.sh @@ -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")" }