本文整理汇总了PHP中QDateTime::IsEarlierOrEqualTo方法的典型用法代码示例。如果您正苦于以下问题:PHP QDateTime::IsEarlierOrEqualTo方法的具体用法?PHP QDateTime::IsEarlierOrEqualTo怎么用?PHP QDateTime::IsEarlierOrEqualTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDateTime
的用法示例。
在下文中一共展示了QDateTime::IsEarlierOrEqualTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calculateValues
function calculateValues(Group $objGroup)
{
global $startDate;
global $endDate;
//global $tempDate;
global $objPersonArray;
global $monthCount;
$objGroupParticipationArray = $objGroup->GetGroupParticipationArray();
foreach ($objGroupParticipationArray as $objParticipation) {
// If role is Volunteer or Volunteer Leader
if ($objParticipation->GroupRole->GroupRoleTypeId == 1 || $objParticipation->GroupRole->GroupRoleTypeId == 3) {
// If a volunteer, then instantiate arrays
$tempDate = new QDateTime($startDate);
while ($tempDate->IsEarlierOrEqualTo($endDate)) {
if ($objParticipation->DateStart < $tempDate && ($objParticipation->DateEnd > $tempDate || $objParticipation->DateEnd == null)) {
// Verify unique person each time
if (!in_array($objParticipation->PersonId, $objPersonArray[$tempDate->__toString('MMM YYYY')])) {
$objPersonArray[$tempDate->__toString('MMM YYYY')][] = $objParticipation->PersonId;
$monthCount[$tempDate->__toString('MMM YYYY')]++;
}
}
$tempDate->AddMonths(1);
}
}
}
}
示例2: GetClassMeetingDays
/**
* Given the start date, end date and meeting day of the week for this class,
* this will return an array of all the meeting days
* @return QDateTime[]
*/
public function GetClassMeetingDays()
{
// Figure out the first real start date
$dttStartDate = new QDateTime($this->DateStart);
if ($dttStartDate->PhpDate('w') < $this->intMeetingDay) {
$dttStartDate->Day += $this->intMeetingDay - $dttStartDate->PhpDate('w');
} else {
if ($dttStartDate->PhpDate('w') > $this->intMeetingDay) {
$dttStartDate->Day += 7 - ($dttStartDate->PhpDate('w') - $this->intMeetingDay);
}
}
// Array to Return
$dttArrayToReturn = array();
while ($dttStartDate->IsEarlierOrEqualTo($this->DateEnd)) {
$dttToAdd = new QDateTime($dttStartDate);
$dttArrayToReturn[] = $dttToAdd;
$dttStartDate->Day += 7;
}
return $dttArrayToReturn;
}