aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2017-03-16 21:53:32 +0100
committerFlorian Fischer <florian.fl.fischer@fau.de>2017-03-16 21:53:32 +0100
commit01a4df472ea2a97d90f2c90772699a3662dda9b4 (patch)
tree6a631dfd9e01aae61eb69aa2cc0f11f0bd67f7cc
parentdff77e6a77a720d458e5ca83bd4b943ceb6104d7 (diff)
downloaddiary-01a4df472ea2a97d90f2c90772699a3662dda9b4.tar.gz
diary-01a4df472ea2a97d90f2c90772699a3662dda9b4.zip
open entry with specific date
-rwxr-xr-xdiary7
1 files changed, 6 insertions, 1 deletions
diff --git a/diary b/diary
index fc4bd94..b3c36f7 100755
--- a/diary
+++ b/diary
@@ -28,7 +28,12 @@ fi
pushd $diary_location > /dev/null
# Get the entry name
-entry=$(date +%Y-%m-%d)
+
+entry=$(date -d $1 +%Y-%m-%d)
+if [ $? -ne 0 ]
+then
+ entry=$(date +%Y-%m-%d)
+fi
if [ ! -f ${entry}* ]
then
echo -e "Rating: " > $entry