diff --git a/doc/calendar.md b/doc/calendar.md index f30ef3f..1b99601 100644 --- a/doc/calendar.md +++ b/doc/calendar.md @@ -152,6 +152,12 @@ after the period. Configuration parameter specifying the current month. Defaults to the current month derived from the current system time. + (*current-day* [day]) + +* ```day``` - a valid cal-day structure + +Configuration parameter specifying the current day. Defaults to +current date. (make-cal-period since before [scomment [bcomment]]) @@ -222,6 +228,24 @@ Returns ```#t``` if given month ```m``` lies within the period Returns ```#t``` if given month ```m``` lies within any of the periods given in the list of periods ```ps```. + (cal-day-in-period? p [d]) + +* ```p``` - a valid cal-period structure +* ```d``` - a valid cal-day or cal-month + +Checks whether given day ```d``` (or month, after conversion to the +first day of given month) belongs to period specified by ```p```. The +period is converted to cal-day period if it is a cal-month period. The +tested day ```d``` defaults to ```(*current-day*)```. + + (cal-day-in-periods? ps [d]) + +* ```ps``` - a list of valid cal-period structures +* ```d``` - a valid cal-day or cal-month + +Returns ```#t``` if ```cal-day-in-period?``` returns ```#t``` for at +least one period in the ```ps``` list. + (cal-periods->string ps) * ```ps``` - a list of periods @@ -265,6 +289,14 @@ If ```v``` is a valid month, returns it unchanged. If it is a day, uses ```cal-day->month``` for conversion with given ```stop?``` as second argument. + (cal-ensure-day v) + +* ```v``` - a valid cal-day or cal-month or ```#f``` + +Returns a valid cal-day structure based on ```v```. If it is a cal-day +or ```#f```, returns it unchanged. If it is a cal-month, returns a +valid cal-day of the first day of given month. + ### Day (import cal-day)