}
cal_date(){
- { [ $# -eq 0 ] && cat || printf %s "$*"; } |sed -rnE '
+ { [ $# -eq 0 ] && cat || printf %s "$*"; } |sed -nE '
2q
s/^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})Z$/\1-\2-\3 \4:\5:\6 UTC/p;t
s/^TZID=(.+)\:([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})$/TZ="\1" \2-\3-\4 \5:\6:\7/p;t
local dstart="${dtstart##*-}"; dstart="${dstart%% *}"
local rrule="$(pdi_value "$course" RRULE)"
- local rr_int="$(printf %s "$rrule" |sed -rn 's;^(.*\;[ ]*)?INTERVAL=([0-9]+)(\;.*)?$;\2;p')"
- local rr_count="$(printf %s "$rrule" |sed -rn 's;^(.*\;[ ]*)?COUNT=([0-9]+)(\;.*)?$;\2;p')"
- local rr_freq="$(printf %s "$rrule" |sed -rn 's;^(.*\;[ ]*)?FREQ=(DAILY|WEEKLY|MONTHLY|YEARLY)(\;.*)?$;\2;p')"
- local rr_until="$(printf %s "$rrule" |sed -rn 's;^(.*\;[ ]*)?UNTIL=([0-9]{8}T[0-9]{6}Z)(\;.*)?$;\2;p')"
+ local rr_int="$(printf %s "$rrule" |sed -nE 's;^(.*\;[ ]*)?INTERVAL=([0-9]+)(\;.*)?$;\2;p')"
+ local rr_count="$(printf %s "$rrule" |sed -nE 's;^(.*\;[ ]*)?COUNT=([0-9]+)(\;.*)?$;\2;p')"
+ local rr_freq="$(printf %s "$rrule" |sed -nE 's;^(.*\;[ ]*)?FREQ=(DAILY|WEEKLY|MONTHLY|YEARLY)(\;.*)?$;\2;p')"
+ local rr_until="$(printf %s "$rrule" |sed -nE 's;^(.*\;[ ]*)?UNTIL=([0-9]{8}T[0-9]{6}Z)(\;.*)?$;\2;p')"
local rr_uyear="${rr_until%????T??????Z}"
local rr_umonth=${rr_until#????}; rr_umonth="${rr_umonth%??T??????Z}"
local rr_uday=${rr_until#??????}; rr_uday="${rr_uday%T??????Z}"