diff --git a/RIGS/models.py b/RIGS/models.py index 6a1801a7..95d50138 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -382,7 +382,7 @@ class Event(models.Model, RevisionMixin): startDateTime = tz.localize(startDateTime) datetime_list.append(startDateTime) # then add it to the list - earliest = min(datetime_list) #find the earliest datetime in the list + earliest = min(datetime_list).astimezone(tz) #find the earliest datetime in the list # if we faked it & it's the earliest, better own up if startTimeFaked and earliest==startDateTime: @@ -393,7 +393,7 @@ class Event(models.Model, RevisionMixin): @property def latest_time(self): """Returns the end of the event - this function could return either a tzaware datetime, or a naiive date object""" - + tz = pytz.timezone(settings.TIME_ZONE) endDate = self.end_date if endDate is None: endDate = self.start_date diff --git a/RIGS/templates/RIGS/calendar.html b/RIGS/templates/RIGS/calendar.html index da40a13a..0ac85749 100644 --- a/RIGS/templates/RIGS/calendar.html +++ b/RIGS/templates/RIGS/calendar.html @@ -17,7 +17,6 @@ $(document).ready(function() { $('#calendar').fullCalendar({ - //defaultDate: '2015-02-12', editable: false, eventLimit: true, // allow "more" link when too many events firstDay: 1, diff --git a/RIGS/views.py b/RIGS/views.py index 0a085b60..2c91807b 100644 --- a/RIGS/views.py +++ b/RIGS/views.py @@ -302,9 +302,6 @@ class SecureAPIRequest(generic.View): start_datetime = datetime.datetime.strptime( start, "%Y-%m-%dT%H:%M:%S" ) end_datetime = datetime.datetime.strptime( end, "%Y-%m-%dT%H:%M:%S" ) - tz = pytz.timezone(settings.TIME_ZONE) - start_datetime = tz.localize(start_datetime) - objects = self.models[model].objects.events_in_bounds(start_datetime,end_datetime) results = []