mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 13:32:15 +00:00
Added a day to end dates, if there is no end time (ical and fullcalendar.js use non-inclusive end dates). Issue #154
This commit is contained in:
@@ -97,6 +97,9 @@ class CalendarICS(ICalFeed):
|
|||||||
return item.earliest_time
|
return item.earliest_time
|
||||||
|
|
||||||
def item_end_datetime(self, item):
|
def item_end_datetime(self, item):
|
||||||
|
if type(item.latest_time) is datetime.date: # Ical end_datetime is non-inclusive, so add a day
|
||||||
|
return item.latest_time + datetime.timedelta(days=1)
|
||||||
|
|
||||||
return item.latest_time
|
return item.latest_time
|
||||||
|
|
||||||
def item_location(self,item):
|
def item_location(self,item):
|
||||||
|
|||||||
@@ -56,11 +56,14 @@
|
|||||||
'non-rig': '#5bc0de'
|
'non-rig': '#5bc0de'
|
||||||
};
|
};
|
||||||
$(doc).each(function() {
|
$(doc).each(function() {
|
||||||
|
end = $(this).attr('latest')
|
||||||
|
if(end.indexOf("T") < 0){ //If latest does not contain a time
|
||||||
|
end = moment(end).add(1, 'days') //End date is non-inclusive, so add a day
|
||||||
|
}
|
||||||
|
|
||||||
thisEvent = {
|
thisEvent = {
|
||||||
'start': $(this).attr('earliest'),
|
'start': $(this).attr('earliest'),
|
||||||
'end': $(this).attr('latest'),
|
'end': end,
|
||||||
'className': 'modal-href',
|
'className': 'modal-href',
|
||||||
'title': $(this).attr('title'),
|
'title': $(this).attr('title'),
|
||||||
'url': $(this).attr('url')
|
'url': $(this).attr('url')
|
||||||
|
|||||||
Reference in New Issue
Block a user