Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. protected function configureDatagridFilters(DatagridMapper $datagridMapper)
  2. {
  3. $now = new \DateTime();
  4. $historyStart = new \DateTime('Dec 20 2016');
  5. $dateFormat = 'd.m.y H';
  6.  
  7. $datagridMapper
  8. ->add(
  9. 'remoteCreatedAt',
  10. 'doctrine_orm_datetime_range',
  11. ['show_filter' => true,],
  12. 'sonata_type_datetime_range_picker',
  13. [
  14. 'field_options_start' => [
  15. 'dp_min_date' => $historyStart->format($dateFormat),
  16. 'dp_max_date' => $now->format($dateFormat),
  17. 'dp_default_date' => $now->format($dateFormat),
  18. 'dp_language' => 'en',
  19. 'format' => 'dd.MM.yy HH',
  20. 'datepicker_use_button' => false,
  21. 'dp_use_minutes' => false,
  22. 'dp_use_seconds' => false,
  23. 'dp_side_by_side' => true,
  24. ],
  25. 'field_options_end' => [
  26. 'dp_min_date' => $historyStart->format($dateFormat),
  27. 'dp_max_date' => $now->format($dateFormat),
  28. 'dp_default_date' => $now->format($dateFormat),
  29. 'dp_language' => 'en',
  30. 'format' => 'dd.MM.yy HH',
  31. 'datepicker_use_button' => false,
  32. 'dp_use_minutes' => false,
  33. 'dp_use_seconds' => false,
  34. 'dp_side_by_side' => true,
  35. ]
  36. ]
  37. );
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement