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


PHP TTDate::isConsecutiveDays方法代碼示例

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


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

示例1: calcOverTimePolicyTotalTime


//.........這裏部分代碼省略.........
                 //5-day/week Consecutive
                 case 154:
                     //6-day/week Consecutive
                 //6-day/week Consecutive
                 case 155:
                     //7-day/week Consecutive
                     switch ($otp_obj->getType()) {
                         case 150:
                             $minimum_days_worked = 2;
                             break;
                         case 151:
                             $minimum_days_worked = 3;
                             break;
                         case 152:
                             $minimum_days_worked = 4;
                             break;
                         case 153:
                             $minimum_days_worked = 5;
                             break;
                         case 154:
                             $minimum_days_worked = 6;
                             break;
                         case 155:
                             $minimum_days_worked = 7;
                             break;
                     }
                     //Should these be reset on the week boundary or should any consecutive days worked apply? Or should we offer both options?
                     //We should probably break this out to just a general "consecutive days worked" and add a field to specify any number of days
                     //and a field to specify if its only per week, or any timeframe.
                     //Will probably want to include a flag to consider scheduled days only too.
                     $days_worked_arr = (array) $udtlf->getDaysWorkedByUserIDAndStartDateAndEndDate($this->getUserDateObject()->getUser(), TTDate::getBeginWeekEpoch($this->getUserDateObject()->getDateStamp(), $start_week_day_id), $this->getUserDateObject()->getDateStamp());
                     $weekly_days_worked = count($days_worked_arr);
                     Debug::text(' Weekly Days Worked: ' . $weekly_days_worked . ' Minimum Required: ' . $minimum_days_worked, __FILE__, __LINE__, __METHOD__, 10);
                     if ($weekly_days_worked >= $minimum_days_worked and TTDate::isConsecutiveDays($days_worked_arr) == TRUE) {
                         $trigger_time = $otp_obj->getTriggerTime();
                         Debug::text(' After Days Consecutive... Daily Trigger Time: ' . $trigger_time, __FILE__, __LINE__, __METHOD__, 10);
                     } else {
                         Debug::text(' NOT After Days Consecutive Worked...', __FILE__, __LINE__, __METHOD__, 10);
                         continue;
                     }
                     unset($days_worked_arr, $weekly_days_worked, $minimum_days_worked);
                     break;
                 case 300:
                     //2-day Consecutive
                 //2-day Consecutive
                 case 301:
                     //3-day Consecutive
                 //3-day Consecutive
                 case 302:
                     //4-day Consecutive
                 //4-day Consecutive
                 case 303:
                     //5-day Consecutive
                 //5-day Consecutive
                 case 304:
                     //6-day Consecutive
                 //6-day Consecutive
                 case 305:
                     //7-day Consecutive
                     switch ($otp_obj->getType()) {
                         case 300:
                             $minimum_days_worked = 2;
                             break;
                         case 301:
                             $minimum_days_worked = 3;
                             break;
開發者ID:alachaum,項目名稱:timetrex,代碼行數:67,代碼來源:UserDateTotalFactory.class.php


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