rec_int="year";;
esac
-if [ "$rec_end" ]; then
- rec_end="$(date -d "$rec_end" +%s)"
-fi
+[ "$rec_end" ] && rec_end="$(date -d "$rec_end" +%s)" \
if LOCK './#events'; then
sed -i "/^${_DATE} /!d" './#events'
- evid="$(wc -l './#events' || printf 0)"
- debug "PAGE: $PATH_INFO $evid"
- printf '%i %i %i %i %s %i %s\n' \
+ evid="$(wc -l <'./#events' || printf 0)"
+ printf '%i %i %i %i %s %i %s %s\n' \
"$_DATE" "$(date -d "$start_date $start_time" +%s)" "$(date -d "$end_date $end_time" +%s)" \
- "${rec_freq:-0}" "${rec_int:-\\}" "${rec_end:--1}" "$(STRING "${PATH_INFO}#event${evid}")" \
+ "${rec_freq:-0}" "${rec_int:-\\}" "${rec_end:--1}" "$(STRING "${title}")" "$(STRING "${PATH_INFO}#event${evid}")" \
>>'./#events'
RELEASE './#events'
fi
while :; do
# mod=$(( (_m - m) % rec_freq )); [ $mod -eq 0 ] && mod="$rec_freq";
m=$(( rec_freq - ((_m - m - 1) % rec_freq + 1) + _m ))
- y=$((m / 12)) m=$((m % 12)); [ $m -eq 0 ] && y=$((y - 1)) m=12;
- nstart="$(printf '%04i-%02i-%02i' "$y" "$m" "$d")"
- if isdate "$nstart" && [ $(date -d "$nstart" +%s) -ge $_DATE ]; then
+ # y=$(((m - 1) / 12)) m=$(((m - 1) % 12 + 1)); # [ $m -eq 0 ] && y=$((y - 1)) m=12;
+ nstart="$(printf '%04i-%02i-%02i' "$(( (m - 1) / 12 ))" "$(( (m - 1) % 12 + 1 ))" "$d")"
+ if isdate "$nstart" && [ "$(date -d "$nstart" +%s)" -ge "$_DATE" ]; then
break
fi >/dev/null
- m=$((y * 12 + m)) _m="$((_m + rec_freq))"
+ # m=$((y * 12 + m))
+ _m="$((_m + rec_freq))"
done
nstart="$(date -d "$nstart $start_time" +%s)"
nend="$((end - start + nstart))"
;;
esac
-if [ "$nstart" -gt "$rec_end" ]; then
+if [ "$nstart" -gt "$rec_end" ] 2>/dev/null; then
nstart="$start" nend="$end"
fi