diff --git a/events/importer.py b/events/importer.py index fe04d35f5..12bf2efce 100644 --- a/events/importer.py +++ b/events/importer.py @@ -7,9 +7,6 @@ from .models import EventLocation, Event, OccurringRule from .utils import extract_date_or_datetime -DATE_RESOLUTION = timedelta(1) -TIME_RESOLUTION = timedelta(0, 0, 1) - logger = logging.getLogger(__name__) @@ -31,10 +28,7 @@ def import_occurrence(self, event, event_data): dt_end = dt_start # Let's mark those occurrences as 'all-day'. - all_day = ( - dt_start.resolution == DATE_RESOLUTION or - dt_end.resolution == DATE_RESOLUTION - ) + all_day = dt_end - dt_start >= timedelta(days=1) defaults = { 'dt_start': dt_start, diff --git a/events/utils.py b/events/utils.py index a3801d4a6..1ddadcc79 100644 --- a/events/utils.py +++ b/events/utils.py @@ -21,7 +21,7 @@ def date_to_datetime(date, tzinfo=None): def extract_date_or_datetime(dt): - if isinstance(dt, datetime.datetime): + if isinstance(dt, datetime.date): return convert_dt_to_aware(dt) return dt