link reporting screen for users and month charts (#1842)

This commit is contained in:
Kevin Papst
2020-07-26 20:28:48 +02:00
committed by GitHub
parent 130e6ac057
commit 599b18ac99
9 changed files with 80 additions and 23 deletions

View File

@@ -20,6 +20,8 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* Custom form field type to select a month via picker and select previous and next month.
*
* Always falls back to the current month if none or an invalid date is given.
*/
final class MonthPickerType extends AbstractType
{
@@ -67,6 +69,7 @@ final class MonthPickerType extends AbstractType
$date = $this->dateTime->getStartOfMonth();
}
$view->vars['month'] = $date;
$view->vars['previousMonth'] = (clone $date)->modify('-1 month');
$view->vars['nextMonth'] = (clone $date)->modify('+1 month');
$view->vars['momentFormat'] = (new MomentFormatConverter())->convert($this->localeSettings->getDateTypeFormat());