dt_navbar_month (private)

 dt_navbar_month view base_url date

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

Parameters:
view
base_url
date
Returns:
the monthly navbar

Partial Call Graph (max 5 caller/called nodes):
%3 dt_widget_calendar_navigation dt_widget_calendar_navigation (public, deprecated) dt_navbar_month dt_navbar_month dt_widget_calendar_navigation->dt_navbar_month dt_left_arrow dt_left_arrow (private) dt_navbar_month->dt_left_arrow dt_right_arrow dt_right_arrow (private) dt_navbar_month->dt_right_arrow

Testcases:
No testcase defined.
Source code:
    set now        [clock scan $date]
    set curr_month [clock format $now -format "%B"]

    # Check that the arrows to prev/next months don't go to illegal dates and bomb
    if {[catch {set prev_month [clock format [clock scan "1 month ago" -base $now] -format "%Y-%m-%d"]} err ]} {
        set prev_month_legal_p 0
    } else {
        if {[catch {clock scan $prev_month}]} {
            set prev_month_legal_p 0
        } else {
            set prev_month_legal_p 1
        }
    }

    if {[catch {set next_month [clock format [clock scan "1 month" -base $now] -format "%Y-%m-%d"]} err]} {
        set next_month_legal_p 0
    } else {
        if {[catch {clock scan $next_month}]} {
            set next_month_legal_p 0
        } else {
            set next_month_legal_p 1
        }
    }

    append results [subst {
        <tr><td class="bottom-border" nowrap align="center" colspan="5">
        <table cellspacing="0" cellpadding="1" border="0">
        <tr><td nowrap valign="middle">
    }]

    # Output link to previous month only if it's legal
    if {$prev_month_legal_p != 0} {
        append results [subst {
            <a href="[ns_quotehtml ${base_url}view=$view&date=[ns_urlencode $prev_month]]">
            <img alt="left arrow" src="[dt_left_arrow]"></a>
        }]
    }

    append results "
    <span style=\"font-size: smaller; font-weight: bold\">$curr_month</span>"

    # Output link to next month only if it's a legal month
    if {$next_month_legal_p != 0} {
        append results [subst {
            <a href="[ns_quotehtml ${base_url}view=$view&date=[ns_urlencode $next_month]]">
            <img border="0" src="[dt_right_arrow]"></a>
        }]
    }

    append results "
    </td>
    </tr>\n"

    return $results
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: