PerlDoc

See PublishedAPI for packages intended to be used by Plugin and Contrib authors, or browse all packages.
See also Developing plugins, Developer's Bible, Technical Overview


Parent package: Foswiki::Plugins::CalendarPlugin
Child packages:

    StaticMethod _formatDate ($cal, $formatString, $date) → $value

    • $cal A reference to the Date::Calc calendar in use.
    • $formatString twiki time date format, default $day $month $year - $hour:$min
    • $date The date (Date::Calc days value) of the date to format. At some point we should handle times, too.
    $formatString supports:
    $seconds secs
    $minutes mins
    $hours hours
    $day date
    $wday weekday name
    $dow day number (0 = Sunday)
    $week week number
    $month month name
    $mo month number
    $year 4-digit year
    $ye 2-digit year
    $http full HTTP header format date/time
    $email full email format date/time
    $rcs full RCS format date/time
    $epoch seconds since 1st January 1970

    Note that this description (and some of the code) is taken from the core function formatTime. Ideally, we would be able to use that function, but that function deals with time in seconds from the epoch and this plugin uses a different notion of time.

    StaticMethod _highlightMultiDay ($cal, $d, $description, $first, $last, $today, $seen, %options) → $value

    • $cal is the current calendar
    • $d is the day (within the calendar/month) to highlight
    • $description is the description of the event
    • $first is the Date::Calc day value of the first day of the event
    • $last is the Date::Calc day value of the last day of the event
    • $today is the Date::Calc day value of the day being highlighted
    • $seen is non-zero (true) if this event has been already been indicated in this calendar
    • %options is a set of plugin options

    The multidayformat option allows the description of each day of a multiday event to be displayed differently. This could be used to visually or textually annotate the description to indicate continuance from or to other days.

    The option consists of a comma separated list of formats for each type of day in a multiday event:

    first, middle, last, middle-unseen, last-unseen

    Where:

    • first is the format used when the first day of the event is displayed
    • middle is the format used when the day being displayed is not the first or last day
    • last is the format used when the last day of the event is displayed
    • middle-unseen is the format used when the day being displayed is not the first or last day of the event, but the preceding days of the event have not been displayed. For example, if an event runs from 29 Apr to 2 May and a May calendar is being displayed, then this format would be used for 1 May.
    • last-unseen is the format used when the day being displayed is the last day of the event, but the preceding days of the event have not been displayed. For example, if an event runs from 29 Apr to 1 May and a May calendar is being displayed, then this format would be used for 1 May. Note that in the previous example (event from 29 Apr to 2 May), this format would not be used for a May calendar because the event was "seen" on 1 May; so, the last format would be used for 2 May.

    Missing formats will be filled in as follows:

    • middle will be set to first
    • last will be set to middle
    • middle-unseen will be set to middle
    • last-unseen will be set to last

    Missing formats are different from empty formats. For example,

    multidayformat="$description (until $last($day $month)),,"

    specifies an empty format for middle and last. The result of this is that only the first day will be shown. Note that since an unspecified middle-unseen is set from the (empty) middle format, an event that begins prior to the calendar being displayed but ending in the current calendar will not be displayed. In contrast, multidayformat="$description" will simply display the description for each day of the event; all days (within the scope of the calendar) will be displayed.

    The default format is to simply display the description of the event.

    Topic revision: r1 - 24 Jun 2022, ProjectContributor
    This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
    Ideas, requests, problems regarding Foswiki? Send feedback