當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DateTimeUtil::getLastDayOfAMonthDate方法代碼示例

本文整理匯總了PHP中DateTimeUtil::getLastDayOfAMonthDate方法的典型用法代碼示例。如果您正苦於以下問題:PHP DateTimeUtil::getLastDayOfAMonthDate方法的具體用法?PHP DateTimeUtil::getLastDayOfAMonthDate怎麽用?PHP DateTimeUtil::getLastDayOfAMonthDate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DateTimeUtil的用法示例。


在下文中一共展示了DateTimeUtil::getLastDayOfAMonthDate方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: makeSearchAttributeData

 protected function makeSearchAttributeData($stringTime = null)
 {
     assert('is_string($stringTime) || $stringTime == null');
     $searchAttributeData = array();
     $searchAttributeData['clauses'] = array(1 => array('attributeName' => 'startDateTime', 'operatorType' => 'greaterThan', 'value' => DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeBeginningOfDay(DateTimeUtil::getFirstDayOfAMonthDate($stringTime))), 2 => array('attributeName' => 'startDateTime', 'operatorType' => 'lessThan', 'value' => DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeEndOfDay(DateTimeUtil::getLastDayOfAMonthDate($stringTime))));
     $searchAttributeData['structure'] = '(1 and 2)';
     return $searchAttributeData;
 }
開發者ID:sandeep1027,項目名稱:zurmo_,代碼行數:8,代碼來源:UpcomingMeetingsCalendarView.php

示例2: makeSearchAttributeData

 /**
  * @param null $stringTime
  * @return array
  */
 protected function makeSearchAttributeData($stringTime = null)
 {
     assert('is_string($stringTime) || $stringTime == null');
     $searchAttributeData = array();
     $searchAttributeData['clauses'] = array(1 => array('attributeName' => 'startDateTime', 'operatorType' => 'greaterThan', 'value' => DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeBeginningOfDay(DateTimeUtil::getFirstDayOfAMonthDate($stringTime))), 2 => array('attributeName' => 'startDateTime', 'operatorType' => 'lessThan', 'value' => DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeEndOfDay(DateTimeUtil::getLastDayOfAMonthDate($stringTime))), 3 => array('attributeName' => 'logged', 'operatorType' => 'doesNotEqual', 'value' => true), 4 => array('attributeName' => 'logged', 'operatorType' => 'isNull', 'value' => null), 5 => array('attributeName' => 'activityItems', 'relatedAttributeName' => 'id', 'operatorType' => 'equals', 'value' => (int) $this->params['relationModel']->getClassId('Item')));
     $searchAttributeData['structure'] = '(1 and 2 and (3 or 4) and 5)';
     return $searchAttributeData;
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:12,代碼來源:UpcomingMeetingsRelatedListView.php

示例3: resolveAttributesAndRelations

 /**
  * The value['type'] determines how the attributeAndRelations is structured.
  * @param string $attributeName
  * @param array $attributeAndRelations
  * @param mixed $value
  */
 public static function resolveAttributesAndRelations($attributeName, &$attributeAndRelations, $value)
 {
     assert('is_string($attributeName)');
     assert('$attributeAndRelations == "resolveEntireMappingByRules"');
     assert('empty($value) || $value == null || is_array($value)');
     $delimiter = FormModelUtil::DELIMITER;
     $parts = explode($delimiter, $attributeName);
     if (count($parts) != 2) {
         throw new NotSupportedException();
     }
     list($realAttributeName, $type) = $parts;
     if (isset($value['type']) && $value['type'] != null) {
         if ($value['type'] == self::TYPE_YESTERDAY || $value['type'] == self::TYPE_TODAY || $value['type'] == self::TYPE_TOMORROW || $value['type'] == self::TYPE_ON) {
             $dateValue = static::resolveValueDataIntoUsableValue($value);
             $greaterThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeBeginningOfDay($dateValue);
             $lessThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeEndOfDay($dateValue);
             $attributeAndRelations = array(array($realAttributeName, null, 'greaterThanOrEqualTo', $greaterThanValue, true), array($realAttributeName, null, 'lessThanOrEqualTo', $lessThanValue, true));
         } elseif ($value['type'] == self::TYPE_AFTER) {
             $dateValue = static::resolveValueDataIntoUsableValue($value);
             $greaterThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeBeginningOfDay($dateValue);
             $attributeAndRelations = array(array($realAttributeName, null, 'greaterThanOrEqualTo', $greaterThanValue));
         } elseif ($value['type'] == self::TYPE_BEFORE) {
             $dateValue = static::resolveValueDataIntoUsableValue($value);
             $lessThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeEndOfDay($dateValue);
             $attributeAndRelations = array(array($realAttributeName, null, 'lessThanOrEqualTo', $lessThanValue));
         } elseif ($value['type'] == self::TYPE_BETWEEN) {
             $firstDateValue = static::resolveValueDataForBetweenIntoUsableFirstDateValue($value);
             $secondDateValue = static::resolveValueDataForBetweenIntoUsableSecondDateValue($value);
             if ($firstDateValue == null) {
                 $greaterThanValue = null;
             } else {
                 $greaterThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeBeginningOfDay($firstDateValue);
             }
             if ($secondDateValue == null) {
                 $lessThanValue = null;
             } else {
                 $lessThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeEndOfDay($secondDateValue);
             }
             $attributeAndRelations = array(array($realAttributeName, null, 'greaterThanOrEqualTo', $greaterThanValue, true), array($realAttributeName, null, 'lessThanOrEqualTo', $lessThanValue, true));
         } elseif ($value['type'] == self::TYPE_NEXT_7_DAYS) {
             $today = static::calculateNewDateByDaysFromNow(0);
             $todayPlusSevenDays = static::calculateNewDateByDaysFromNow(7);
             $greaterThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeBeginningOfDay($today);
             $lessThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeEndOfDay($todayPlusSevenDays);
             $attributeAndRelations = array(array($realAttributeName, null, 'greaterThanOrEqualTo', $greaterThanValue, true), array($realAttributeName, null, 'lessThanOrEqualTo', $lessThanValue, true));
         } elseif ($value['type'] == self::TYPE_LAST_7_DAYS) {
             $today = static::calculateNewDateByDaysFromNow(0);
             $todayMinusSevenDays = static::calculateNewDateByDaysFromNow(-7);
             $greaterThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeBeginningOfDay($todayMinusSevenDays);
             $lessThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeEndOfDay($today);
             $attributeAndRelations = array(array($realAttributeName, null, 'greaterThanOrEqualTo', $greaterThanValue, true), array($realAttributeName, null, 'lessThanOrEqualTo', $lessThanValue, true));
         } elseif ($value['type'] == self::TYPE_LAST_30_DAYS) {
             $today = static::calculateNewDateByDaysFromNow(0);
             $todayMinusThirtyDays = static::calculateNewDateByDaysFromNow(-30);
             $greaterThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeBeginningOfDay($todayMinusThirtyDays);
             $lessThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeEndOfDay($today);
             $attributeAndRelations = array(array($realAttributeName, null, 'greaterThanOrEqualTo', $greaterThanValue, true), array($realAttributeName, null, 'lessThanOrEqualTo', $lessThanValue, true));
         } elseif ($value['type'] == self::TYPE_THIS_MONTH) {
             $firstDateValue = DateTimeUtil::getFirstDayOfAMonthDate();
             $secondDateValue = DateTimeUtil::getLastDayOfAMonthDate();
             $greaterThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeBeginningOfDay($firstDateValue);
             $lessThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeEndOfDay($secondDateValue);
             $attributeAndRelations = array(array($realAttributeName, null, 'greaterThanOrEqualTo', $greaterThanValue, true), array($realAttributeName, null, 'lessThanOrEqualTo', $lessThanValue, true));
         } elseif ($value['type'] == self::TYPE_LAST_MONTH) {
             $firstDateValue = DateTimeUtil::getFirstDayOfLastMonthDate();
             $secondDateValue = DateTimeUtil::getLastDayOfLastMonthDate();
             $greaterThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeBeginningOfDay($firstDateValue);
             $lessThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeEndOfDay($secondDateValue);
             $attributeAndRelations = array(array($realAttributeName, null, 'greaterThanOrEqualTo', $greaterThanValue, true), array($realAttributeName, null, 'lessThanOrEqualTo', $lessThanValue, true));
         } elseif ($value['type'] == self::TYPE_NEXT_MONTH) {
             $firstDateValue = DateTimeUtil::getFirstDayOfNextMonthDate();
             $secondDateValue = DateTimeUtil::getLastDayOfNextMonthDate();
             $greaterThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeBeginningOfDay($firstDateValue);
             $lessThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeEndOfDay($secondDateValue);
             $attributeAndRelations = array(array($realAttributeName, null, 'greaterThanOrEqualTo', $greaterThanValue, true), array($realAttributeName, null, 'lessThanOrEqualTo', $lessThanValue, true));
         } elseif ($value['type'] == self::TYPE_BEFORE_TODAY) {
             $today = static::calculateNewDateByDaysFromNow(0);
             $lessThanValue = DateTimeUtil::convertDateIntoTimeZoneAdjustedDateTimeEndOfDay($today);
             $attributeAndRelations = array(array($realAttributeName, null, 'lessThanOrEqualTo', $lessThanValue));
         } else {
             throw new NotSupportedException();
         }
     } else {
         $attributeAndRelations = array(array($realAttributeName, null, null, 'resolveValueByRules'));
     }
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:92,代碼來源:MixedDateTimeTypesSearchFormAttributeMappingRules.php


注:本文中的DateTimeUtil::getLastDayOfAMonthDate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。