mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Fixed some #timezoneIssues
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 = []
|
||||
|
||||
Reference in New Issue
Block a user