示例#1
0
function month_navbar($month, $year)
{
    $html = tag('div', attributes('class="phpc-navbar"'));
    menu_item_append($html, _('last year'), 'display', $year - 1, $month);
    menu_item_append($html, _('last month'), 'display', $year, $month - 1);
    for ($i = 1; $i <= 12; $i++) {
        menu_item_append($html, short_month_name($i), 'display', $year, $i);
    }
    menu_item_append($html, _('next month'), 'display', $year, $month + 1);
    menu_item_append($html, _('next year'), 'display', $year + 1, $month);
    return $html;
}
示例#2
0
function format_date_string($year, $month, $day, $date_format)
{
    $month_name = short_month_name($month);
    switch ($date_format) {
        case 0:
            // Month Day Year
            return "{$month_name} {$day}, {$year}";
        case 1:
            // Year Month Day
            return "{$year} {$month_name} {$day}";
        case 2:
            // Day Month Year
            return "{$day} {$month_name} {$year}";
        default:
            soft_error("Invalid date_format");
    }
}