X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=courses%2Fwidgets.sh;h=fee7690aae41850154d1422216ba5b18e919da0e;hp=6123aa0923d70801f4a7cfbf3619d4668cf18679;hb=HEAD;hpb=27eaed1f6c5be64e58e84a7019f6d9e6d08ce6fb diff --git a/courses/widgets.sh b/courses/widgets.sh index 6123aa0..fee7690 100755 --- a/courses/widgets.sh +++ b/courses/widgets.sh @@ -35,7 +35,7 @@ w_sort_courses(){ } 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 @@ -53,7 +53,7 @@ cal_item(){ case $item in SUMMARY) - printf '[h2 ­%s]' "$(pdi_value "$course" SUMMARY)" + printf '[h2 . %s]' "$(pdi_value "$course" SUMMARY)" ;; DTSTART) printf '[span .text .DTSTART %s %s ]' \ @@ -160,10 +160,10 @@ edit_item(){ 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}"