Commits

Luke Plant committed b82b45b

Fixed bug with display of date ranges.

  • Participants
  • Parent commits 731c76c

Comments (0)

Files changed (2)

django_easyfilters/filters.py

 
     @staticmethod
     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)])
 

django_easyfilters/tests/filterset.py

         # 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']})