1. Luke Plant
  2. django-easyfilters


Luke Plant  committed b82b45b

Fixed bug with display of date ranges.

  • Participants
  • Parent commits 731c76c
  • Branches default

Comments (0)

Files changed (2)

File django_easyfilters/filters.py

View file
     def from_datetime_range(range_type, dt1, dt2):
-        return DateChoice(range_type,
+        return DateChoice(range_type.to_multi(),
                           [DateChoice.datetime_to_value(range_type, dt1),
                            DateChoice.datetime_to_value(range_type, dt2)])

File django_easyfilters/tests/filterset.py

View file
         # We have enough data that it will not show a simple list of years.
         choices = f.get_choices(qs)
         self.assertTrue(len(choices) <= 10)
+        self.assertTrue('-' in choices[0].label)
     def test_datetime_filter_single_year_selected(self):
         params = MultiValueDict({'date_published':['1818']})