本文整理匯總了PHP中w2p_Utilities_Date::equals方法的典型用法代碼示例。如果您正苦於以下問題:PHP w2p_Utilities_Date::equals方法的具體用法?PHP w2p_Utilities_Date::equals怎麽用?PHP w2p_Utilities_Date::equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類w2p_Utilities_Date
的用法示例。
在下文中一共展示了w2p_Utilities_Date::equals方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: remove
public function remove(CAppUI $AppUI, w2p_Utilities_Date $date)
{
$perms = $AppUI->acl();
$removed = false;
if ($this->holiday_id && $perms->checkModuleItem('holiday', 'edit', $this->holiday_id)) {
$holiday_start_date = new w2p_Utilities_Date($this->holiday_start_date);
$holiday_end_date = new w2p_Utilities_Date($this->holiday_end_date);
if ($holiday_start_date->equals($date->duplicate())) {
if ($holiday_end_date->equals($date->duplicate())) {
$removed = $this->delete($AppUI);
} else {
$holiday_start_date = new w2p_Utilities_Date($this->holiday_start_date);
$this->holiday_start_date = $holiday_start_date->getNextDay()->getDate();
$removed = $this->store($AppUI);
}
} elseif ($holiday_end_date->equals($date->duplicate())) {
$holiday_end_date = new w2p_Utilities_Date($this->holiday_end_date);
$this->holiday_end_date = $holiday_end_date->getPrevDay()->getDate();
$removed = $this->store($AppUI);
} elseif ($holiday_start_date->before($date->duplicate()) && $holiday_end_date->after($date->duplicate())) {
$holiday_end_date = $this->holiday_end_date;
$this->holiday_end_date = $date->getPrevDay()->getDate();
$removed = $this->store($AppUI);
$this->holiday_id = 0;
// create new record
$this->holiday_start_date = $date->getNextDay()->getDate();
$this->holiday_end_date = $holiday_end_date;
$removed = $this->store($AppUI);
}
}
return $removed;
}