當前位置: 首頁>>代碼示例>>PHP>>正文


PHP I18N::firstDay方法代碼示例

本文整理匯總了PHP中Fisharebest\Webtrees\I18N::firstDay方法的典型用法代碼示例。如果您正苦於以下問題:PHP I18N::firstDay方法的具體用法?PHP I18N::firstDay怎麽用?PHP I18N::firstDay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Fisharebest\Webtrees\I18N的用法示例。


在下文中一共展示了I18N::firstDay方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: count

     echo '</td>';
     echo '</tr><tr>';
     echo '<td class="descriptionbox">', I18N::translate('Total individuals: %s', count($indis));
     echo '<br>';
     echo '<i class="icon-sex_m_15x15" title="', I18N::translate('Males'), '"></i> ', $males, ' ';
     echo '<i class="icon-sex_f_15x15" title="', I18N::translate('Females'), '"></i> ', $females, ' ';
     if (count($indis) !== $males + $females) {
         echo '<i class="icon-sex_u_15x15" title="', I18N::translate('All individuals'), '"></i> ', count($indis) - $males - $females;
     }
     echo '</td>';
     echo '<td class="descriptionbox">', I18N::translate('Total families: %s', count($fams)), '</td>';
     echo '</tr></table>';
     break;
 case 'month':
     // We use JD%7 = 0/Mon…6/Sun. Standard definitions use 0/Sun…6/Sat.
     $week_start = (I18N::firstDay() + 6) % 7;
     $weekend_start = (I18N::weekendStart() + 6) % 7;
     $weekend_end = (I18N::weekendEnd() + 6) % 7;
     // The french  calendar has a 10-day week, which starts on primidi
     if ($days_in_week === 10) {
         $week_start = 0;
         $weekend_start = -1;
         $weekend_end = -1;
     }
     echo '<table class="width100"><thead><tr>';
     for ($week_day = 0; $week_day < $days_in_week; ++$week_day) {
         $day_name = $cal_date->dayNames(($week_day + $week_start) % $days_in_week);
         if ($week_day == $weekend_start || $week_day == $weekend_end) {
             echo '<th class="descriptionbox weekend" width="' . 100 / $days_in_week . '%">', $day_name, '</th>';
         } else {
             echo '<th class="descriptionbox" width="' . 100 / $days_in_week . '%">', $day_name, '</th>';
開發者ID:josefpavlik,項目名稱:webtrees,代碼行數:31,代碼來源:calendar.php

示例2: initializeCalendarPopup

    /**
     * javascript declaration for calendar popup
     */
    public static function initializeCalendarPopup()
    {
        global $controller;
        $controller->addInlineJavascript('
			cal_setMonthNames(
				"' . I18N::translateContext('NOMINATIVE', 'January') . '",
				"' . I18N::translateContext('NOMINATIVE', 'February') . '",
				"' . I18N::translateContext('NOMINATIVE', 'March') . '",
				"' . I18N::translateContext('NOMINATIVE', 'April') . '",
				"' . I18N::translateContext('NOMINATIVE', 'May') . '",
				"' . I18N::translateContext('NOMINATIVE', 'June') . '",
				"' . I18N::translateContext('NOMINATIVE', 'July') . '",
				"' . I18N::translateContext('NOMINATIVE', 'August') . '",
				"' . I18N::translateContext('NOMINATIVE', 'September') . '",
				"' . I18N::translateContext('NOMINATIVE', 'October') . '",
				"' . I18N::translateContext('NOMINATIVE', 'November') . '",
				"' . I18N::translateContext('NOMINATIVE', 'December') . '"
			)
			cal_setDayHeaders(
				"' . I18N::translate('Sun') . '",
				"' . I18N::translate('Mon') . '",
				"' . I18N::translate('Tue') . '",
				"' . I18N::translate('Wed') . '",
				"' . I18N::translate('Thu') . '",
				"' . I18N::translate('Fri') . '",
				"' . I18N::translate('Sat') . '"
			)
			cal_setWeekStart(' . I18N::firstDay() . ');
		');
    }
開發者ID:jflash,項目名稱:webtrees,代碼行數:33,代碼來源:FunctionsPrint.php


注:本文中的Fisharebest\Webtrees\I18N::firstDay方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。