X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=macros%2Fevent;h=0ca81afba7e6ac2e79e0d26b34b602bcd25793be;hb=fd1e97fbca8ee7f27f5b2ad1bc14e0ac1a64f9ce;hp=4b3881057713f9edeb59abbbebe78544f3f20889;hpb=08ecb8b08cd5a1cf5cc7507e9d41fb3e09e24c5d;p=shellwiki diff --git a/macros/event b/macros/event index 4b38810..0ca81af 100755 --- a/macros/event +++ b/macros/event @@ -105,8 +105,13 @@ if [ ! "$end_time" ]; then end_time="23:59" fi +shh=${start_time%:*} shh="${shh#0}" +smm=${start_time#*:} smm="${smm#0}" +ehh=${end_time%:*} ehh="${ehh#0}" +emm=${end_time#*:} emm="${emm#0}" + if [ ! "$end_date" -a "$end_time" -a "$start_time" ]; then - if [ "$((${end_time%:*} * 60 + ${end_time#*:}))" -gt "$((${start_time%:*} * 60 + ${start_time#*:}))" ]; then + if [ "$((ehh * 60 + emm))" -gt "$((shh * 60 + smm))" ]; then end_date="$start_date" else end_date="$(date -ud "@$(($(date -ud "$start_date" +%s) + 86400))" +%F)"