本文整理匯總了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;