protected function offsetLatestValue($latestQuarterValue, $offset)
 {
     // convering number of quarters to number of months
     $monthOffset = $offset * 3;
     $datetime = new DateTime($latestQuarterValue);
     $datetime->sub(new DateInterval("P{$monthOffset}M"));
     return $datetime->format(DateDataTypeHandler::getDateMask());
 }
 public static function adjustToFirstDayOfFiscalYear($date)
 {
     $proxy = new DateTimeProxy(new DateTime($date));
     list($fiscalYear) = DateDimensionConfiguration::getFiscalMonth($proxy->getYear(), $proxy->getMonth());
     // converting the date to the first day of corresponding year
     $adjustedDateTime = new DateTime();
     $adjustedDateTime->setDate($fiscalYear, 1, 1);
     return $adjustedDateTime->format(DateDataTypeHandler::getDateMask());
 }
 public function selectCompatible($datatype)
 {
     return $datatype == DateDataTypeHandler::$DATA_TYPE ? DateDataTypeHandler::$DATA_TYPE : parent::selectCompatible($datatype);
 }
예제 #4
0
 /**
  * @return DB
  */
 private function getDataRecords()
 {
     DateDataTypeHandler::$MASK_CUSTOM = 'Y-m-d';
     ini_set('max_execution_time', 0);
     $records = get_db_results(TRUE, $this->requestDataSet->name, $this->requestDataSet->columns, $this->requestDataSet->parameters, $this->requestDataSet->sortColumn, $this->requestDataSet->startWith, $this->requestDataSet->limit, NULL);
     return $records;
 }