本文整理汇总了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;