From 7960ae5d4c057d28f67263dc547d84e3ea8e06fc Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 4 Dec 2006 10:59:10 +0000 Subject: Vin Shelton: 23027: typo in calsys.yo unposted: missing autoload in calendar_add, improve age date shortcuts --- Functions/Calendar/age | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Functions/Calendar/age') 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 -- cgit 1.4.1