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