dt_widget_month (public, deprecated)

 dt_widget_month [ -calendar_details calendar_details ] [ -date date ] \
    [ -days_of_week days_of_week ] \
    [ -large_calendar_p large_calendar_p ] \
    [ -master_bgcolor master_bgcolor ] \
    [ -header_bgcolor header_bgcolor ] \
    [ -header_text_color header_text_color ] \
    [ -header_text_size header_text_size ] \
    [ -day_number_template day_number_template ] \
    [ -day_header_size day_header_size ] \
    [ -day_header_bgcolor day_header_bgcolor ] \
    [ -calendar_width calendar_width ] [ -day_bgcolor day_bgcolor ] \
    [ -today_bgcolor today_bgcolor ] \
    [ -day_text_color day_text_color ] \
    [ -empty_bgcolor empty_bgcolor ] \
    [ -next_month_template next_month_template ] \
    [ -prev_month_template prev_month_template ] \
    [ -prev_next_links_in_title prev_next_links_in_title ] \
    [ -fill_all_days fill_all_days ] \
    [ -show_calendar_name_p show_calendar_name_p ]

Defined in packages/acs-datetime/tcl/acs-calendar-procs.tcl

Deprecated. Invoking this procedure generates a warning.

Switches:
-calendar_details
(optional)
-date
(optional)
-days_of_week
(optional)
-large_calendar_p
(defaults to "1") (optional)
-master_bgcolor
(defaults to "black") (optional)
-header_bgcolor
(defaults to "black") (optional)
-header_text_color
(defaults to "white") (optional)
-header_text_size
(defaults to "+2") (optional)
-day_number_template
(defaults to "<!--$julian_date-->$day_number") (optional)
-day_header_size
(defaults to "2") (optional)
-day_header_bgcolor
(defaults to "#666666") (optional)
-calendar_width
(defaults to "100%") (optional)
-day_bgcolor
(defaults to "#DDDDDD") (optional)
-today_bgcolor
(defaults to "#DDDDDD") (optional)
-day_text_color
(defaults to "white") (optional)
-empty_bgcolor
(defaults to "white") (optional)
-next_month_template
(optional)
-prev_month_template
(optional)
-prev_next_links_in_title
(defaults to "0") (optional)
-fill_all_days
(defaults to "0") (optional)
-show_calendar_name_p
(defaults to "1") (optional)
Returns:
a calendar for a specific month, with details supplied by Julian date. Defaults to this month. To specify details for the individual days (if large_calendar_p is set) put data in an ns_set calendar_details. The key is the Julian date of the day, and the value is a string (possibly with HTML formatting) that represents the details. DEPRECATED: modern HTML5 feature make this widget less relevant. It is also cumbersome to style and localize.
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 dt_widget_month_small dt_widget_month_small (public, deprecated) dt_widget_month dt_widget_month dt_widget_month_small->dt_widget_month _ _ (public) dt_widget_month->_ ad_log_deprecated ad_log_deprecated (public) dt_widget_month->ad_log_deprecated dt_ansi_to_julian dt_ansi_to_julian (public) dt_widget_month->dt_ansi_to_julian dt_ansi_to_list dt_ansi_to_list (public) dt_widget_month->dt_ansi_to_list dt_get_info dt_get_info (public) dt_widget_month->dt_get_info

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc dt_widget_month
    if {$days_of_week eq ""} {
        set days_of_week "[_ acs-datetime.days_of_week]"
    }

    dt_get_info $date

    set today_date [dt_sysdate]

    if {$calendar_details eq ""} {
        set calendar_details [ns_set create calendar_details]
    }

    set day_of_week $first_day_of_month
    set julian_date $first_julian_date

    set month_heading [format "%s %s" $month $year]
    set next_month_url ""
    set prev_month_url ""

    if {$prev_month_template ne ""} {
        set ansi_date      [ns_urlencode $prev_month]
        set prev_month_url [subst $prev_month_template]
    }

    if {$next_month_template ne ""} {
        set ansi_date      [ns_urlencode $next_month]
        set next_month_url [subst $next_month_template]
    }

    # We offer an option to put the links to next and previous months
    # in the title bar

    if { $prev_next_links_in_title == 0 } {
        set title [subst {
            <td colspan="7" align="center">
            <span style="font-size:$header_text_size; color:$header_text_color; background:inherit; font-weight:bold">
            $month_heading
            </span>
            </td>\n}]
    } else {
        set title [subst {
            <td class="no-border" colspan="7">
            <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr class="table-header">
            <td align="left">$prev_month_url</td>
            <td align="center">
            <span style="font-size:$header_text_size; color:$header_text_color; background:inherit; font-weight:bold">
            $month_heading
            </span>
            </td>
            <td align="right">$next_month_url</td>
            </tr>
            </table>
            </td>\n}]
    }

    # Write out the header and the days of the week

    append output [subst {
        <table class="table-display" style="background:$master_bgcolor; color:inherit;" cellpadding="0" cellspacing="0" border="1" width="$calendar_width">
        <tr style="background:$header_bgcolor; color:inherit;"$title </tr>
        <tr style="background:$day_header_bgcolor; color:inherit;" class="table-header">\n}]

    foreach day_of_week $days_of_week {
        append output [subst {
            <td style="width:14%" align=center class="no-border">
            <span style="font-family: Verdana,Arial,Helvetica; font-size:$day_header_size; color:$day_text_color; background:inherit; font-weight:bold;">
            $day_of_week
            </span>
            </td>\n}]
    }

    append output "</tr>\n"

    set day_of_week 1
    set julian_date $first_julian_date
    set day_number $first_day

    set today_ansi_list [dt_ansi_to_list $today_date]
    set today_julian_date [dt_ansi_to_julian [lindex $today_ansi_list 0] [lindex $today_ansi_list 1] [lindex $today_ansi_list 2]]

    while {1} {

        if {$julian_date < $first_julian_date_of_month} {
            set before_month_p 1
            set after_month_p  0
        } elseif {$julian_date > $last_julian_date_in_month} {
            set before_month_p 0
            set after_month_p  1
        } else {
            set before_month_p 0
            set after_month_p  0
        }

        if {$julian_date == $first_julian_date_of_month} {
            set day_number 1
        } elseif {$julian_date > $last_julian_date} {
            break
        } elseif {$julian_date == $last_julian_date_in_month + 1} {
            set day_number 1
        }

        if { $day_of_week == 1} {
            append output "<tr>\n"
        }

        set skip_day 0

        if {$before_month_p || $after_month_p} {
            append output "<td class=\"no-border\" style=\"background:$empty_bgcolor; color:inherit;\" align=right valign=top>&nbsp;"
            if { $fill_all_days == 0 } {
                set skip_day 1
            } else {
                append output [subst $day_number_template"&nbsp;"
            }
        } else {
            if {$julian_date == $today_julian_date} {
                set the_bgcolor $today_bgcolor
                set the_class "cal-month-today"
            } else {
                set the_bgcolor $day_bgcolor
                set the_class "cal-month-day"
            }

            append output [subst {<td class="$the_class" style="background:$the_bgcolor; color:inherit;" align="left" valign="top">$day_number_template}] "&nbsp;"
        }

        if { !$skip_day && $large_calendar_p == 1 } {
            append output "<div align=left>"

            set calendar_day_index [ns_set find $calendar_details $julian_date]

            while { $calendar_day_index >= 0 } {
                set calendar_day [ns_set value $calendar_details $calendar_day_index]
                ns_set delete $calendar_details $calendar_day_index
                append output "$calendar_day"
                set calendar_day_index [ns_set find $calendar_details $julian_date]
            }
            append output "</div>"
        }

        append output "</td>\n"

        incr day_of_week
        incr julian_date
        incr day_number

        if { $day_of_week > 7 } {
            set day_of_week 1
            append output "</tr>\n"
        }
    }

    # There are two ways to display previous and next month link -
    # this is the default

    if { $prev_next_links_in_title == 0 } {
        append output [subst {
            <tr style="background:white; color:inherit;">
            <td align=center colspan=7>$prev_month_url$next_month_url</td>
            </tr>\n}]
    }

    return [concat $output "</table>\n"]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: