about summary refs log tree commit diff
path: root/Functions/Calendar/age
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-12-04 10:59:10 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-12-04 10:59:10 +0000
commit7960ae5d4c057d28f67263dc547d84e3ea8e06fc (patch)
tree1252b6aedbdb39c30ae225b1141744ff45d1c1d9 /Functions/Calendar/age
parent34381548da094d1be0b06f802d131f960b061ffe (diff)
downloadzsh-7960ae5d4c057d28f67263dc547d84e3ea8e06fc.tar.gz
zsh-7960ae5d4c057d28f67263dc547d84e3ea8e06fc.tar.xz
zsh-7960ae5d4c057d28f67263dc547d84e3ea8e06fc.zip
Vin Shelton: 23027: typo in calsys.yo
unposted: missing autoload in calendar_add, improve age date shortcuts
Diffstat (limited to 'Functions/Calendar/age')
-rw-r--r--Functions/Calendar/age13
1 files changed, 10 insertions, 3 deletions
diff --git a/Functions/Calendar/age b/Functions/Calendar/age
index 2d193f473..b6f648adb 100644
--- a/Functions/Calendar/age
+++ b/Functions/Calendar/age
@@ -55,11 +55,18 @@ fi
 integer mtime=$vals[1] date1 date2
 local REPLY
 
-if calendar_scandate $AGEREF; then
+# allow a time only (meaning today)
+if calendar_scandate -t $AGEREF; then
   date1=$REPLY
 
-  if [[ -n $AGEREF2 ]] && calendar_scandate $AGEREF2; then
-    date2=$REPLY
+  if [[ -n $AGEREF2 ]]; then
+    if [[ $AGEREF2 = +* ]]; then
+      calendar_scandate -rt $AGEREF2[2,-1] || return 1
+      (( date2 = date1 + REPLY ))
+    else
+      calendar_scandate -t $AGEREF2 || return 1
+      date2=$REPLY
+    fi
   else
     (( date2 = date1 + 24 * 60 * 60 ))
   fi