private function formatByGroupingMode(
        $groupingMode,
        $groupingLength,
        EnvironmentInterface $environment,
        PropertyInterface $property,
        ModelInterface $model
    ) {
        switch ($groupingMode) {
            case GroupAndSortingInformationInterface::GROUP_CHAR:
                return $this->formatByCharGrouping(
                    ViewHelpers::getReadableFieldValue($environment, $property, $model),
                    $groupingLength
                );

            case GroupAndSortingInformationInterface::GROUP_DAY:
                return $this->formatByDayGrouping((int) $model->getProperty($property->getName()));

            case GroupAndSortingInformationInterface::GROUP_MONTH:
                return $this->formatByMonthGrouping((int) $model->getProperty($property->getName()));

            case GroupAndSortingInformationInterface::GROUP_YEAR:
                return $this->formatByYearGrouping((int) $model->getProperty($property->getName()));

            default:
                return ViewHelpers::getReadableFieldValue($environment, $property, $model);
        }
    }