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()); }
protected function prepareExpression(DataControllerCallContext $callcontext, AbstractRequest $request, $datasetName, $columnName, $columnDataType) { $proxy = new DateTimeProxy(); list($fiscalYear) = FiscalYearConfiguration::getAsFiscal($proxy->getYear(), $proxy->getMonth()); return $this->prepareExpressionImpl($callcontext, $request, $datasetName, $columnName, $columnDataType, $fiscalYear); }