当前位置: 首页>>代码示例>>PHP>>正文


PHP Date_Calc::getWeekdayAbbrname方法代码示例

本文整理汇总了PHP中Date_Calc::getWeekdayAbbrname方法的典型用法代码示例。如果您正苦于以下问题:PHP Date_Calc::getWeekdayAbbrname方法的具体用法?PHP Date_Calc::getWeekdayAbbrname怎么用?PHP Date_Calc::getWeekdayAbbrname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Date_Calc的用法示例。


在下文中一共展示了Date_Calc::getWeekdayAbbrname方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getDayName

 /**
  * Gets the full name or abbriviated name of this weekday
  *
  * Gets the full name or abbriviated name of this weekday
  *
  * @access public
  * @param boolean $abbr abbrivate the name
  * @return string name of this day
  */
 function getDayName($abbr = false, $length = 3)
 {
     if ($abbr) {
         return Date_Calc::getWeekdayAbbrname($this->day, $this->month, $this->year, $length);
     } else {
         return Date_Calc::getWeekdayFullname($this->day, $this->month, $this->year);
     }
 }
开发者ID:mickdane,项目名称:zidisha,代码行数:17,代码来源:Date.php

示例2: showDays

function showDays()
{
    global $allocated_hours_sum, $end_date, $start_date, $AppUI, $user_list, $user_names, $user_usage, $hideNonWd, $table_header, $table_rows, $df, $working_days_count, $total_hours_capacity, $total_hours_capacity_all;
    $days_difference = $end_date->dateDiff($start_date);
    $actual_date = $start_date;
    $working_days_count = 0;
    $allocated_hours_sum = 0;
    $table_header = "<tr><th>" . $AppUI->_("User") . "</th>";
    for ($i = 0; $i <= $days_difference; $i++) {
        if ($actual_date->isWorkingDay() || !$actual_date->isWorkingDay() && !$hideNonWd) {
            $table_header .= "<th>" . utf8_encode(Date_Calc::getWeekdayAbbrname($actual_date->day, $actual_date->month, $actual_date->year, 3)) . "<br>" . $actual_date->format('%d/%m') . "</th>";
        }
        if ($actual_date->isWorkingDay()) {
            $working_days_count++;
        }
        $actual_date->addDays(1);
    }
    $table_header .= "<th nowrap='nowrap' colspan='2'>" . $AppUI->_("Allocated") . "</th></tr>";
    $table_rows = "";
    foreach ($user_list as $user_id => $user_data) {
        @($user_names[$user_id] = $user_data["user_username"]);
        if (isset($user_usage[$user_id])) {
            $table_rows .= "<tr><td nowrap='nowrap'>(" . $user_data["user_username"] . ") " . $user_data["contact_first_name"] . " " . $user_data["contact_last_name"] . "</td>";
            $actual_date = $start_date;
            for ($i = 0; $i <= $days_difference; $i++) {
                if ($actual_date->isWorkingDay() || !$actual_date->isWorkingDay() && !$hideNonWd) {
                    $table_rows .= "<td>";
                    if (isset($user_usage[$user_id][$actual_date->format("%Y%m%d")])) {
                        $hours = number_format($user_usage[$user_id][$actual_date->format("%Y%m%d")], 2);
                        $table_rows .= $hours;
                        $percentage_used = round($hours / dPgetConfig("daily_working_hours") * 100);
                        $bar_color = "blue";
                        if ($percentage_used > 100) {
                            $bar_color = "red";
                            $percentage_used = 100;
                        }
                        $table_rows .= "<div style='height:2px;width:{$percentage_used}%; background-color:{$bar_color}'>&nbsp;</div>";
                    } else {
                        $table_rows .= "&nbsp;";
                    }
                    $table_rows .= "</td>";
                }
                $actual_date->addDays(1);
            }
            $array_sum = array_sum($user_usage[$user_id]);
            $average_user_usage = number_format($array_sum / ($working_days_count * dPgetConfig("daily_working_hours")) * 100, 2);
            $allocated_hours_sum += $array_sum;
            $bar_color = "blue";
            if ($average_user_usage > 100) {
                $bar_color = "red";
                $average_user_usage = 100;
            }
            $table_rows .= "<td ><div align='left'>" . round($array_sum, 2) . " " . $AppUI->_("hours") . "</td> <td align='right'> " . $average_user_usage;
            $table_rows .= "%</div>";
            $table_rows .= "<div align='left' style='height:2px;width:{$average_user_usage}%; background-color:{$bar_color}'>&nbsp;</div></td>";
            $table_rows .= "</tr>";
        }
    }
    $total_hours_capacity = $working_days_count * dPgetConfig("daily_working_hours") * count($user_usage);
    $total_hours_capacity_all = $working_days_count * dPgetConfig("daily_working_hours") * count($user_list);
}
开发者ID:n2i,项目名称:xvnkb,代码行数:61,代码来源:allocateduserhours.php

示例3: dateFormat

 /**
  *  Formats the date in the given format, much like
  *  strfmt(). This function is used to alleviate the
  *  problem with 32-bit numbers for dates pre 1970
  *  or post 2038, as strfmt() has on most systems.
  *  Most of the formatting options are compatible.
  *
  *  formatting options:
  *
  *  %a        abbreviated weekday name (Sun, Mon, Tue)
  *  %A        full weekday name (Sunday, Monday, Tuesday)
  *  %b        abbreviated month name (Jan, Feb, Mar)
  *  %B        full month name (January, February, March)
  *  %d        day of month (range 00 to 31)
  *  %e        day of month, single digit (range 0 to 31)
  *  %E        number of days since unspecified epoch (integer)
  *             (%E is useful for passing a date in a URL as
  *             an integer value. Then simply use
  *             daysToDate() to convert back to a date.)
  *  %j        day of year (range 001 to 366)
  *  %m        month as decimal number (range 1 to 12)
  *  %n        newline character (\n)
  *  %t        tab character (\t)
  *  %w        weekday as decimal (0 = Sunday)
  *  %U        week number of current year, first sunday as first week
  *  %y        year as decimal (range 00 to 99)
  *  %Y        year as decimal including century (range 0000 to 9999)
  *  %%        literal '%'
  *
  * @param string year in format CCYY
  * @param string month in format MM
  * @param string day in format DD
  * @param string format for returned date
  *
  * @access public
  *
  * @return string date in given format
  */
 function dateFormat($day, $month, $year, $format)
 {
     if (!Date_Calc::isValidDate($day, $month, $year)) {
         $year = Date_Calc::dateNow("%Y");
         $month = Date_Calc::dateNow("%m");
         $day = Date_Calc::dateNow("%d");
     }
     $output = "";
     for ($strpos = 0; $strpos < strlen($format); $strpos++) {
         $char = substr($format, $strpos, 1);
         if ($char == "%") {
             $nextchar = substr($format, $strpos + 1, 1);
             switch ($nextchar) {
                 case "a":
                     $output .= Date_Calc::getWeekdayAbbrname($day, $month, $year);
                     break;
                 case "A":
                     $output .= Date_Calc::getWeekdayFullname($day, $month, $year);
                     break;
                 case "b":
                     $output .= Date_Calc::getMonthAbbrname($month);
                     break;
                 case "B":
                     $output .= Date_Calc::getMonthFullname($month);
                     break;
                 case "d":
                     $output .= sprintf("%02d", $day);
                     break;
                 case "e":
                     $output .= $day;
                     break;
                 case "E":
                     $output .= Date_Calc::dateToDays($day, $month, $year);
                     break;
                 case "j":
                     $output .= Date_Calc::julianDate($day, $month, $year);
                     break;
                 case "m":
                     $output .= sprintf("%02d", $month);
                     break;
                 case "n":
                     $output .= "\n";
                     break;
                 case "t":
                     $output .= "\t";
                     break;
                 case "w":
                     $output .= Date_Calc::dayOfWeek($day, $month, $year);
                     break;
                 case "U":
                     $output .= Date_Calc::weekOfYear($day, $month, $year);
                     break;
                 case "y":
                     $output .= substr($year, 2, 2);
                     break;
                 case "Y":
                     $output .= $year;
                     break;
                 case "%":
                     $output .= "%";
                     break;
                 default:
//.........这里部分代码省略.........
开发者ID:noikiy,项目名称:owaspbwa,代码行数:101,代码来源:Calc.php

示例4: dateFormat

 /**
  * Formats the date in the given format, much like strfmt()
  *
  * This function is used to alleviate the problem with 32-bit numbers for
  * dates pre 1970 or post 2038, as strfmt() has on most systems.
  * Most of the formatting options are compatible.
  *
  * Formatting options:
  * <pre>
  * %a   abbreviated weekday name (Sun, Mon, Tue)
  * %A   full weekday name (Sunday, Monday, Tuesday)
  * %b   abbreviated month name (Jan, Feb, Mar)
  * %B   full month name (January, February, March)
  * %d   day of month (range 00 to 31)
  * %e   day of month, single digit (range 0 to 31)
  * %E   number of days since unspecified epoch (integer)
  *        (%E is useful for passing a date in a URL as
  *        an integer value. Then simply use
  *        daysToDate() to convert back to a date.)
  * %j   day of year (range 001 to 366)
  * %m   month as decimal number (range 1 to 12)
  * %n   newline character (\n)
  * %t   tab character (\t)
  * %w   weekday as decimal (0 = Sunday)
  * %U   week number of current year, first sunday as first week
  * %y   year as decimal (range 00 to 99)
  * %Y   year as decimal including century (range 0000 to 9999)
  * %%   literal '%'
  * </pre>
  *
  * @param int    $day    the day of the month
  * @param int    $month  the month
  * @param int    $year   the year.  Use the complete year instead of the
  *                        abbreviated version.  E.g. use 2005, not 05.
  * @param string $format the format string
  *
  * @return   string     the date in the desired format
  * @access   public
  * @static
  */
 function dateFormat($day, $month, $year, $format)
 {
     if (!Date_Calc::isValidDate($day, $month, $year)) {
         $year = Date_Calc::dateNow('%Y');
         $month = Date_Calc::dateNow('%m');
         $day = Date_Calc::dateNow('%d');
     }
     $output = '';
     for ($strpos = 0; $strpos < strlen($format); $strpos++) {
         $char = substr($format, $strpos, 1);
         if ($char == '%') {
             $nextchar = substr($format, $strpos + 1, 1);
             switch ($nextchar) {
                 case 'a':
                     $output .= Date_Calc::getWeekdayAbbrname($day, $month, $year);
                     break;
                 case 'A':
                     $output .= Date_Calc::getWeekdayFullname($day, $month, $year);
                     break;
                 case 'b':
                     $output .= Date_Calc::getMonthAbbrname($month);
                     break;
                 case 'B':
                     $output .= Date_Calc::getMonthFullname($month);
                     break;
                 case 'd':
                     $output .= sprintf('%02d', $day);
                     break;
                 case 'e':
                     $output .= $day;
                     break;
                 case 'E':
                     $output .= Date_Calc::dateToDays($day, $month, $year);
                     break;
                 case 'j':
                     $output .= Date_Calc::dayOfYear($day, $month, $year);
                     break;
                 case 'm':
                     $output .= sprintf('%02d', $month);
                     break;
                 case 'n':
                     $output .= "\n";
                     break;
                 case 't':
                     $output .= "\t";
                     break;
                 case 'w':
                     $output .= Date_Calc::dayOfWeek($day, $month, $year);
                     break;
                 case 'U':
                     $output .= Date_Calc::weekOfYear($day, $month, $year);
                     break;
                 case 'y':
                     $output .= sprintf('%0' . ($year < 0 ? '3' : '2') . 'd', $year % 100);
                     break;
                 case "Y":
                     $output .= sprintf('%0' . ($year < 0 ? '5' : '4') . 'd', $year);
                     break;
                 case '%':
                     $output .= '%';
//.........这里部分代码省略.........
开发者ID:222elm,项目名称:dotprojectFrame,代码行数:101,代码来源:Calc.php

示例5: compare

compare(2451716.56767, Date_Calc::dateSeason('SUMMERSOLSTICE', 2000), 'dateSeason');
compare(date('Ymd'), Date_Calc::dateNow(), 'dateNow');
compare(date('Y'), Date_Calc::getYear(), 'getYear');
compare(date('m'), Date_Calc::getMonth(), 'getMonth');
compare(date('d'), Date_Calc::getDay(), 'getDay');
compare(327, Date_Calc::dayOfYear(22, 11, 2000), 'dayOfYear');
compare('November', Date_Calc::getMonthFullname(11), 'getMonthFullname');
compare('Nov', Date_Calc::getMonthAbbrname(11), 'getMonthAbbrname');
compare('Saturday', Date_Calc::getWeekdayFullname(1, 1, 2005), 'getWeekdayFullname');
compare('Sat', Date_Calc::getWeekdayAbbrname(1, 1, 2005), 'getWeekdayAbbrname');
compare(11, Date_Calc::getMonthFromFullName('November'), 'getMonthFromFullName');
compare(327, Date_Calc::dayOfYear('22', '11', '2000'), 'dayOfYear str');
compare('November', Date_Calc::getMonthFullname('11'), 'getMonthFullname str');
compare('Nov', Date_Calc::getMonthAbbrname('11'), 'getMonthAbbrname str');
compare('Saturday', Date_Calc::getWeekdayFullname('01', '01', '2005'), 'getWeekdayFullname str');
compare('Sat', Date_Calc::getWeekdayAbbrname('01', '01', '2005'), 'getWeekdayAbbrname str');
$exp = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
compare($exp, Date_Calc::getMonthNames(), 'getMonthNames');
$exp = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday');
compare($exp, Date_Calc::getWeekDays(), 'getWeekDays');
compare(3, Date_Calc::dayOfWeek(22, 11, 2000), 'dayOfWeek');
compare(47, Date_Calc::weekOfYear(22, 11, 2000), 'weekOfYear');
compare(4, Date_Calc::quarterOfYear(22, 11, 2000), 'quarterOfYear');
compare(3, Date_Calc::dayOfWeek('22', '11', '2000'), 'dayOfWeek str');
compare(47, Date_Calc::weekOfYear('22', '11', '2000'), 'weekOfYear str');
compare(4, Date_Calc::quarterOfYear('22', '11', '2000'), 'quarterOfYear str');
compare(28, Date_Calc::daysInMonth(2, 1900), 'daysInMonth 1');
compare(29, Date_Calc::daysInMonth(2, 1996), 'daysInMonth 2');
compare(29, Date_Calc::daysInMonth(2, 2000), 'daysInMonth 3');
compare(28, Date_Calc::daysInMonth(2, 2001), 'daysInMonth 4');
compare(30, Date_Calc::daysInMonth(11, 2000), 'daysInMonth 5');
开发者ID:MagnusA,项目名称:Date,代码行数:31,代码来源:calc.php

示例6: utf8_encode

                     $user_tasks_counted_in[$user_id][$task->task_project][$task->task_id] = 0;
                 }
                 // We add it up
                 $user_tasks_counted_in[$user_id][$task->task_project][$task->task_id] += $hours_added;
             }
         }
         $actual_date->addDays(1);
     }
 }
 $days_difference = $end_date->dateDiff($start_date);
 $actual_date = $start_date;
 $working_days_count = 0;
 $allocated_hours_sum = 0;
 $table_header = "<tr><th>" . $AppUI->_("User") . "</th>";
 for ($i = 0; $i <= $days_difference; $i++) {
     $table_header .= "<th>" . utf8_encode(Date_Calc::getWeekdayAbbrname($actual_date->day, $actual_date->month, $actual_date->year, 3)) . "</th>";
     if ($actual_date->isWorkingDay()) {
         $working_days_count++;
     }
     $actual_date->addDays(1);
 }
 $table_header .= "<th nowrap='nowrap' colspan='2'>" . $AppUI->_("Allocated") . "</th></tr>";
 $table_rows = "";
 foreach ($user_list as $user_id => $user_data) {
     @($user_names[$user_id] = $user_data["user_username"]);
     if (isset($user_usage[$user_id])) {
         $table_rows .= "<tr><td nowrap='nowrap'>(" . $user_data["user_username"] . ") " . $user_data["contact_first_name"] . " " . $user_data["contact_last_name"] . "</td>";
         $actual_date = $start_date;
         for ($i = 0; $i <= $days_difference; $i++) {
             $table_rows .= "<td>";
             if (isset($user_usage[$user_id][$actual_date->format("%Y%m%d")])) {
开发者ID:Esleelkartea,项目名称:gestion-de-primeras-muestras,代码行数:31,代码来源:allocateduserhours.php


注:本文中的Date_Calc::getWeekdayAbbrname方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。