calendar files

This commit is contained in:
root committed 2018-01-19 13:08:11 -05:00
1 parent 5790ddf906
commit 33cc552f55
3 files changed
+245

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
---
layout: default
---
<div>
<h1>Termine</h1>
<p>Den Kalender gibt's auch per CalDAV:
<a href="webcal://cloud.chaospott.de/remote.php/dav/public-calendars/5HM7B0ZOLEYC3QD0?export">
Chaospott Calendar
</a>
</p>
</div>
<div id="calendar">
Loading Events, please stand by …
</div>
<script src="js/ical.min.js"></script>
<script src="js/cal.js"></script>
</div>
</article>
</body>
</html>
+215
View File
@@ -0,0 +1,215 @@
var eventList = []
var cancelledEvents = {}
function Event (start, event) {
if (!(start instanceof Date)) {
start = start.toJSDate()
}
this.start = start
this.event = event
this.end = new Date(this.start.getTime() + this.event.duration.toSeconds()*1000)
this.summary = event.summary || 'No title'
this.description = event.description
this.location = event.location || false
this.lasts_several_days = this.start.toDateString() !== this.end.toDateString()
}
Event.prototype.isCancelled = function () {
if (cancelledEvents[this.event.uid] instanceof Array
&& cancelledEvents[this.event.uid].includes(this.start.getTime())) return true
return false
}
Event.prototype.toHTML = function () {
var br = document.createElement('br')
var div_cal = document.createElement('div')
div_cal.setAttribute('class', 'cal_entry')
var div_datetime = document.createElement('div')
div_datetime.setAttribute('class', 'cal_datetime')
var span_date = document.createElement('span')
span_date.setAttribute('class', 'cal_date')
span_date.appendChild(document.createTextNode(this.start.toLocaleDateString([], {year: 'numeric', month: '2-digit', day: '2-digit'})))
div_datetime.appendChild(span_date)
if (this.lasts_several_days) {
var span_end_date = document.createElement('span')
span_end_date.setAttribute('class', 'cal_date')
span_end_date.appendChild(document.createTextNode(' - ' + this.end.toLocaleString([], {year: 'numeric', month: '2-digit', day: '2-digit'})))
div_datetime.appendChild(span_end_date)
} else {
var span_day = document.createElement('span')
span_day.setAttribute('class', 'cal_day')
span_day.appendChild((document.createTextNode(this.start.toLocaleDateString([], {weekday: 'long'}))))
div_datetime.appendChild(span_day)
}
var span_time = document.createElement('span')
span_time.setAttribute('class', 'cal_time')
span_time.appendChild(document.createTextNode(this.start.toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'})))
div_datetime.appendChild(span_time)
var span_summary = document.createElement('span')
span_summary.setAttribute('class', 'cal_summary')
span_summary.appendChild(document.createTextNode(this.summary))
var div_description = document.createElement('div')
div_description.setAttribute('class', 'cal_descriptionbox')
div_description.appendChild(span_summary)
if (this.location !== false && !/w(ilhelminenstra(ss|ß)e )17/i.test(this.location)) {
var span_location = document.createElement('span')
span_location.setAttribute('class', 'cal_location')
var span_location_icon = document.createElement('i')
span_location_icon.setAttribute('class', 'fa fa-map-marker')
span_location_icon.setAttribute('aria-hidden', 'true')
span_location.appendChild(span_location_icon)
if (this.location.match(/tb(a|d)/i)) {
span_location.appendChild(document.createTextNode(this.location))
} else {
var a_location_osm = document.createElement('a')
a_location_osm.setAttribute('href', 'https://www.openstreetmap.org/search?query=' + encodeURI(this.location))
a_location_osm.appendChild(document.createTextNode(this.location))
span_location.appendChild(a_location_osm)
}
div_description.appendChild(span_location)
}
div_cal.appendChild(div_datetime)
div_cal.appendChild(div_description)
if (this.description !== null) {
var parts = this.description.split(/\r\n|\r|\n/)
parts.map(function (i) {
var span_description = document.createElement('span')
span_description.setAttribute('class', 'cal_description')
words = i.split(' ')
words.forEach(function(word) {
if (word.match(/(ht|f)tps?\:\/\//i)) {
var a = document.createElement('a')
a.setAttribute('href', word)
a.appendChild(document.createTextNode(word))
span_description.appendChild(a)
} else {
span_description.appendChild(document.createTextNode(word))
}
span_description.appendChild(document.createTextNode(' '))
})
div_description.appendChild(span_description)
})
}
if (this.isCancelled()) {
div_cal.style.textDecoration = 'line-through'
}
return div_cal
}
function parseIcalData(data) {
var timeRangeStart = new Date()
var timeRangeStop = new Date()
timeRangeStart.setHours(0, 0, 0)
timeRangeStop.setMonth(timeRangeStop.getMonth() + 1)
var jcalData = ICAL.parse(data)
var vcalendar = new ICAL.Component(jcalData)
var events = vcalendar.getAllSubcomponents('vevent')
events.map(function (e) {
var event = new ICAL.Event(e)
if (event.isRecurring()) {
var expand = event.iterator()
var next
var exList = []
event.component.getAllProperties('exdate').map(function (ex) {
exList.push(ex.getFirstValue().toJSDate().getTime())
})
while ((next = expand.next()) && next.toJSDate() < timeRangeStop) {
if (!exList.includes(next.toJSDate().getTime())
&& timeRangeStart < next.toJSDate() && next.toJSDate() < timeRangeStop) {
eventList.push(new Event(next, event))
}
}
} else if (eventInTimeRange(event, timeRangeStart, timeRangeStop)) {
if (event.component.getFirstPropertyValue("status") == "CANCELLED") {
console.log(event)
if (!(cancelledEvents[event.uid] instanceof Array)) {
cancelledEvents[event.uid] = []
}
cancelledEvents[event.uid].push(event.startDate.toJSDate().getTime())
} else {
eventList.push(new Event(event.startDate, event))
}
}
})
}
function eventInTimeRange(event, start, stop) {
if (start < event.startDate.toJSDate() && event.startDate.toJSDate() < stop
|| start < event.endDate.toJSDate() && event.endDate.toJSDate() < stop
|| event.startDate.toJSDate() < start && stop < event.endDate.toJSDate()) return true
return false
}
function orderEvents() {
eventList.sort(function (e1, e2) {
return e1.start - e2.start
})
}
function writeEvents() {
var cal = document.getElementById('calendar')
cal.textContent = ''
if (eventList.length > 0) {
eventList.map(function (e) {
cal.appendChild(e.toHTML())
})
} else {
cal.textContent = 'No events found.'
}
}
function xhrRequest(url, callback, fail) {
var xhr = new XMLHttpRequest()
xhr.onreadystatechange = function () {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
callback(xhr.responseText)
} else {
fail(xhr.status)
}
}
}
xhr.open('GET', url)
xhr.send()
}
function processData(data) {
parseIcalData(data)
orderEvents()
writeEvents()
}
function requestFailed(status) {
document.getElementById('calendar').textContent = 'Something has gone wrong. Try reloading the page.'
}
xhrRequest('https://cloud.chaospott.de/remote.php/dav/public-calendars/5HM7B0ZOLEYC3QD0?export', processData, requestFailed)
+4
View File
@@ -0,0 +1,4 @@
"object"==typeof module?ICAL=module.exports:"object"!=typeof ICAL&&(this.ICAL={}),ICAL.foldLength=75,ICAL.newLineChar="\r\n",ICAL.helpers={isStrictlyNaN:function(a){return"number"==typeof a&&isNaN(a)},strictParseInt:function(a){var b=parseInt(a,10);if(ICAL.helpers.isStrictlyNaN(b))throw new Error('Could not extract integer from "'+a+'"');return b},formatClassType:function(a,b){if("undefined"!=typeof a)return a instanceof b?a:new b(a)},unescapedIndexOf:function(a,b,c){for(;(c=a.indexOf(b,c))!==-1;){if(!(c>0&&"\\"===a[c-1]))return c;c+=1}return-1},binsearchInsert:function(a,b,c){if(!a.length)return 0;for(var d,e,f=0,g=a.length-1;f<=g;)if(d=f+Math.floor((g-f)/2),e=c(b,a[d]),e<0)g=d-1;else{if(!(e>0))break;f=d+1}return e<0?d:e>0?d+1:d},dumpn:function(){ICAL.debug&&("undefined"!=typeof console&&"log"in console?ICAL.helpers.dumpn=function(a){console.log(a)}:ICAL.helpers.dumpn=function(a){dump(a+"\n")},ICAL.helpers.dumpn(arguments[0]))},clone:function(a,b){if(a&&"object"==typeof a){if(a instanceof Date)return new Date(a.getTime());if("clone"in a)return a.clone();if(Array.isArray(a)){for(var c=[],d=0;d<a.length;d++)c.push(b?ICAL.helpers.clone(a[d],!0):a[d]);return c}var e={};for(var f in a)Object.prototype.hasOwnProperty.call(a,f)&&(b?e[f]=ICAL.helpers.clone(a[f],!0):e[f]=a[f]);return e}return a},foldline:function(a){for(var b="",c=a||"";c.length;)b+=ICAL.newLineChar+" "+c.substr(0,ICAL.foldLength),c=c.substr(ICAL.foldLength);return b.substr(ICAL.newLineChar.length+1)},pad2:function(a){"string"!=typeof a&&("number"==typeof a&&(a=parseInt(a)),a=String(a));var b=a.length;switch(b){case 0:return"00";case 1:return"0"+a;default:return a}},trunc:function(a){return a<0?Math.ceil(a):Math.floor(a)},inherits:function(a,b,c){function d(){}d.prototype=a.prototype,b.prototype=new d,c&&ICAL.helpers.extend(c,b.prototype)},extend:function(a,b){for(var c in a){var d=Object.getOwnPropertyDescriptor(a,c);d&&!Object.getOwnPropertyDescriptor(b,c)&&Object.defineProperty(b,c,d)}return b}},ICAL.design=function(){"use strict";function a(a,b){var d={matches:/.*/,fromICAL:function(b,d){return c(b,a,d)},toICAL:function(a,c){var d=b;return c&&(d=new RegExp(d.source+"|"+c)),a.replace(d,function(a){switch(a){case"\\":return"\\\\";case";":return"\\;";case",":return"\\,";case"\n":return"\\n";default:return a}})}};return d}function b(a){switch(a){case"\\\\":return"\\";case"\\;":return";";case"\\,":return",";case"\\n":case"\\N":return"\n";default:return a}}function c(a,c,d){return a.indexOf("\\")===-1?a:(d&&(c=new RegExp(c.source+"|\\\\"+d)),a.replace(c,b))}var d=/\\\\|\\;|\\,|\\[Nn]/g,e=/\\|;|,|\n/g,f=/\\\\|\\,|\\[Nn]/g,g=/\\|,|\n/g,h={defaultType:"text"},i={defaultType:"text",multiValue:","},j={defaultType:"text",structuredValue:";"},k={defaultType:"integer"},l={defaultType:"date-time",allowedTypes:["date-time","date"]},m={defaultType:"date-time"},n={defaultType:"uri"},o={defaultType:"utc-offset"},p={defaultType:"recur"},q={defaultType:"date-and-or-time",allowedTypes:["date-time","date","text"]},r={categories:i,url:n,version:h,uid:h},s={boolean:{values:["TRUE","FALSE"],fromICAL:function(a){switch(a){case"TRUE":return!0;case"FALSE":return!1;default:return!1}},toICAL:function(a){return a?"TRUE":"FALSE"}},float:{matches:/^[+-]?\d+\.\d+$/,fromICAL:function(a){var b=parseFloat(a);return ICAL.helpers.isStrictlyNaN(b)?0:b},toICAL:function(a){return String(a)}},integer:{fromICAL:function(a){var b=parseInt(a);return ICAL.helpers.isStrictlyNaN(b)?0:b},toICAL:function(a){return String(a)}},"utc-offset":{toICAL:function(a){return a.length<7?a.substr(0,3)+a.substr(4,2):a.substr(0,3)+a.substr(4,2)+a.substr(7,2)},fromICAL:function(a){return a.length<6?a.substr(0,3)+":"+a.substr(3,2):a.substr(0,3)+":"+a.substr(3,2)+":"+a.substr(5,2)},decorate:function(a){return ICAL.UtcOffset.fromString(a)},undecorate:function(a){return a.toString()}}},t={cutype:{values:["INDIVIDUAL","GROUP","RESOURCE","ROOM","UNKNOWN"],allowXName:!0,allowIanaToken:!0},"delegated-from":{valueType:"cal-address",multiValue:",",multiValueSeparateDQuote:!0},"delegated-to":{valueType:"cal-address",multiValue:",",multiValueSeparateDQuote:!0},encoding:{values:["8BIT","BASE64"]},fbtype:{values:["FREE","BUSY","BUSY-UNAVAILABLE","BUSY-TENTATIVE"],allowXName:!0,allowIanaToken:!0},member:{valueType:"cal-address",multiValue:",",multiValueSeparateDQuote:!0},partstat:{values:["NEEDS-ACTION","ACCEPTED","DECLINED","TENTATIVE","DELEGATED","COMPLETED","IN-PROCESS"],allowXName:!0,allowIanaToken:!0},range:{values:["THISLANDFUTURE"]},related:{values:["START","END"]},reltype:{values:["PARENT","CHILD","SIBLING"],allowXName:!0,allowIanaToken:!0},role:{values:["REQ-PARTICIPANT","CHAIR","OPT-PARTICIPANT","NON-PARTICIPANT"],allowXName:!0,allowIanaToken:!0},rsvp:{values:["TRUE","FALSE"]},"sent-by":{valueType:"cal-address"},tzid:{matches:/^\//},value:{values:["binary","boolean","cal-address","date","date-time","duration","float","integer","period","recur","text","time","uri","utc-offset"],allowXName:!0,allowIanaToken:!0}},u=ILine truncated
a+="P",this.weeks&&(a+=this.weeks+"W"),this.days&&(a+=this.days+"D"),(this.hours||this.minutes||this.seconds)&&(a+="T",this.hours&&(a+=this.hours+"H"),this.minutes&&(a+=this.minutes+"M"),this.seconds&&(a+=this.seconds+"S")),a},toICALString:function(){return this.toString()}},ICAL.Duration.fromSeconds=function(a){return(new ICAL.Duration).fromSeconds(a)},ICAL.Duration.isValueString=function(a){return"P"===a[0]||"P"===a[1]},ICAL.Duration.fromString=function(c){for(var d=0,e=Object.create(null),f=0;(d=c.search(b))!==-1;){var g=c[d],h=c.substr(0,d);c=c.substr(d+1),f+=a(g,h,e)}if(f<2)throw new Error('invalid duration value: Not enough duration components in "'+c+'"');return new ICAL.Duration(e)},ICAL.Duration.fromData=function(a){return new ICAL.Duration(a)}}(),function(){var a=["tzid","location","tznames","latitude","longitude"];ICAL.Timezone=function(a){this.wrappedJSObject=this,this.fromData(a)},ICAL.Timezone.prototype={tzid:"",location:"",tznames:"",latitude:0,longitude:0,component:null,expandedUntilYear:0,icalclass:"icaltimezone",fromData:function(b){if(this.expandedUntilYear=0,this.changes=[],b instanceof ICAL.Component)this.component=b;else{if(b&&"component"in b)if("string"==typeof b.component){var c=ICAL.parse(b.component);this.component=new ICAL.Component(c)}else b.component instanceof ICAL.Component?this.component=b.component:this.component=null;for(var d in a)if(a.hasOwnProperty(d)){var e=a[d];b&&e in b&&(this[e]=b[e])}}return this.component instanceof ICAL.Component&&!this.tzid&&(this.tzid=this.component.getFirstPropertyValue("tzid")),this},utcOffset:function(a){if(this==ICAL.Timezone.utcTimezone||this==ICAL.Timezone.localTimezone)return 0;if(this._ensureCoverage(a.year),!this.changes.length)return 0;for(var b={year:a.year,month:a.month,day:a.day,hour:a.hour,minute:a.minute,second:a.second},c=this._findNearbyChange(b),d=-1,e=1;;){var f=ICAL.helpers.clone(this.changes[c],!0);f.utcOffset<f.prevUtcOffset?ICAL.Timezone.adjust_change(f,0,0,0,f.utcOffset):ICAL.Timezone.adjust_change(f,0,0,0,f.prevUtcOffset);var g=ICAL.Timezone._compare_change_fn(b,f);if(g>=0?d=c:e=-1,e==-1&&d!=-1)break;if(c+=e,c<0)return 0;if(c>=this.changes.length)break}var h=this.changes[d],i=h.utcOffset-h.prevUtcOffset;if(i<0&&d>0){var j=ICAL.helpers.clone(h,!0);if(ICAL.Timezone.adjust_change(j,0,0,0,j.prevUtcOffset),ICAL.Timezone._compare_change_fn(b,j)<0){var k=this.changes[d-1],l=!1;h.is_daylight!=l&&k.is_daylight==l&&(h=k)}}return h.utcOffset},_findNearbyChange:function(a){var b=ICAL.helpers.binsearchInsert(this.changes,a,ICAL.Timezone._compare_change_fn);return b>=this.changes.length?this.changes.length-1:b},_ensureCoverage:function(a){if(ICAL.Timezone._minimumExpansionYear==-1){var b=ICAL.Time.now();ICAL.Timezone._minimumExpansionYear=b.year}var c=a;if(c<ICAL.Timezone._minimumExpansionYear&&(c=ICAL.Timezone._minimumExpansionYear),c+=ICAL.Timezone.EXTRA_COVERAGE,c>ICAL.Timezone.MAX_YEAR&&(c=ICAL.Timezone.MAX_YEAR),!this.changes.length||this.expandedUntilYear<a){for(var d=this.component.getAllSubcomponents(),e=d.length,f=0;f<e;f++)this._expandComponent(d[f],c,this.changes);this.changes.sort(ICAL.Timezone._compare_change_fn),this.expandedUntilYear=c}},_expandComponent:function(a,b,c){function d(a){return a.factor*(3600*a.hours+60*a.minutes)}function e(){var b={};return b.is_daylight="daylight"==a.name,b.utcOffset=d(a.getFirstProperty("tzoffsetto").getFirstValue()),b.prevUtcOffset=d(a.getFirstProperty("tzoffsetfrom").getFirstValue()),b}if(!a.hasProperty("dtstart")||!a.hasProperty("tzoffsetto")||!a.hasProperty("tzoffsetfrom"))return null;var f,g=a.getFirstProperty("dtstart").getFirstValue();if(a.hasProperty("rrule")||a.hasProperty("rdate")){var h=a.getAllProperties("rdate");for(var i in h)if(h.hasOwnProperty(i)){var j=h[i],k=j.getFirstValue();f=e(),f.year=k.year,f.month=k.month,f.day=k.day,k.isDate?(f.hour=g.hour,f.minute=g.minute,f.second=g.second,g.zone!=ICAL.Timezone.utcTimezone&&ICAL.Timezone.adjust_change(f,0,0,0,-f.prevUtcOffset)):(f.hour=k.hour,f.minute=k.minute,f.second=k.second,k.zone!=ICAL.Timezone.utcTimezone&&ICAL.Timezone.adjust_change(f,0,0,0,-f.prevUtcOffset)),c.push(f)}var l=a.getFirstProperty("rrule");if(l){l=l.getFirstValue(),f=e(),l.until&&l.until.zone==ICAL.Timezone.utcTimezone&&(l.until.adjust(0,0,0,f.prevUtcOffset),l.until.zone=ICAL.Timezone.localTimezone);for(var m,n=l.iterator(g);(m=n.next())&&(f=e(),!(m.year>b)&&m);)f.year=m.year,f.month=m.month,f.day=m.day,f.hour=m.hour,f.minute=m.minute,f.second=m.second,f.isDate=m.isDate,ICAL.Timezone.adjust_change(f,0,0,0,-f.prevUtcOffset),c.push(f)}}else f=e(),f.year=g.year,f.month=g.month,f.day=g.day,f.hour=g.hour,f.minute=g.minute,f.second=g.second,ICAL.Timezone.adjust_change(f,0,0,0,-f.prevUtcOffset),c.push(f);return c},toString:function(){return this.tznames?this.tznames:this.tzid}},ICAL.Timezone._compare_change_fn=function(a,b){return a.year<b.year?-1:a.year>b.year?1:a.month<b.month?-1:a.month>b.month?1:a.day<b.day?-1:a.day>b.day?1:a.hour<b.hour?-1:a.hour>b.hour?1:a.Line truncated
this.last.day=c.day,this.last.month=c.month},ruleDayOfWeek:function(a){var b=a.match(/([+-]?[0-9])?(MO|TU|WE|TH|FR|SA|SU)/);if(b){var c=parseInt(b[1]||0,10);return a=ICAL.Recur.icalDayToNumericDay(b[2]),[c,a]}return[0,0]},next_generic:function(a,b,c,d,e){var f=a in this.by_data,g=this.rule.freq==b,h=0;if(e&&0==this[e]())return h;if(f){this.by_indices[a]++;var i=(this.by_indices[a],this.by_data[a]);this.by_indices[a]==i.length&&(this.by_indices[a]=0,h=1),this.last[c]=i[this.by_indices[a]]}else g&&this["increment_"+c](this.rule.interval);return f&&h&&g&&this["increment_"+d](1),h},increment_monthday:function(a){for(var b=0;b<a;b++){var c=ICAL.Time.daysInMonth(this.last.month,this.last.year);this.last.day++,this.last.day>c&&(this.last.day-=c,this.increment_month())}},increment_month:function(){if(this.last.day=1,this.has_by_data("BYMONTH"))this.by_indices.BYMONTH++,this.by_indices.BYMONTH==this.by_data.BYMONTH.length&&(this.by_indices.BYMONTH=0,this.increment_year(1)),this.last.month=this.by_data.BYMONTH[this.by_indices.BYMONTH];else{"MONTHLY"==this.rule.freq?this.last.month+=this.rule.interval:this.last.month++,this.last.month--;var a=ICAL.helpers.trunc(this.last.month/12);this.last.month%=12,this.last.month++,0!=a&&this.increment_year(a)}},increment_year:function(a){this.last.year+=a},increment_generic:function(a,b,c,d){this.last[b]+=a;var e=ICAL.helpers.trunc(this.last[b]/c);this.last[b]%=c,0!=e&&this["increment_"+d](e)},has_by_data:function(a){return a in this.rule.parts},expand_year_days:function(a){var b=new ICAL.Time;this.days=[];var c={},d=["BYDAY","BYWEEKNO","BYMONTHDAY","BYMONTH","BYYEARDAY"];for(var e in d)if(d.hasOwnProperty(e)){var f=d[e];f in this.rule.parts&&(c[f]=this.rule.parts[f])}if("BYMONTH"in c&&"BYWEEKNO"in c){var g=1,h={};b.year=a,b.isDate=!0;for(var i=0;i<this.by_data.BYMONTH.length;i++){var j=this.by_data.BYMONTH[i];b.month=j,b.day=1;var k=b.weekNumber(this.rule.wkst);b.day=ICAL.Time.daysInMonth(j,a);var l=b.weekNumber(this.rule.wkst);for(i=k;i<l;i++)h[i]=1}for(var m=0;m<this.by_data.BYWEEKNO.length&&g;m++){var n=this.by_data.BYWEEKNO[m];n<52?g&=h[m]:g=0}g?delete c.BYMONTH:delete c.BYWEEKNO}var o=Object.keys(c).length;if(0==o){var p=this.dtstart.clone();p.year=this.last.year,this.days.push(p.dayOfYear())}else if(1==o&&"BYMONTH"in c){for(var q in this.by_data.BYMONTH)if(this.by_data.BYMONTH.hasOwnProperty(q)){var r=this.dtstart.clone();r.year=a,r.month=this.by_data.BYMONTH[q],r.isDate=!0,this.days.push(r.dayOfYear())}}else if(1==o&&"BYMONTHDAY"in c){for(var s in this.by_data.BYMONTHDAY)if(this.by_data.BYMONTHDAY.hasOwnProperty(s)){var t=this.dtstart.clone(),u=this.by_data.BYMONTHDAY[s];if(u<0){var v=ICAL.Time.daysInMonth(t.month,a);u=u+v+1}t.day=u,t.year=a,t.isDate=!0,this.days.push(t.dayOfYear())}}else if(2==o&&"BYMONTHDAY"in c&&"BYMONTH"in c){for(var q in this.by_data.BYMONTH)if(this.by_data.BYMONTH.hasOwnProperty(q)){var w=this.by_data.BYMONTH[q],v=ICAL.Time.daysInMonth(w,a);for(var s in this.by_data.BYMONTHDAY)if(this.by_data.BYMONTHDAY.hasOwnProperty(s)){var u=this.by_data.BYMONTHDAY[s];u<0&&(u=u+v+1),b.day=u,b.month=w,b.year=a,b.isDate=!0,this.days.push(b.dayOfYear())}}}else if(1==o&&"BYWEEKNO"in c);else if(2==o&&"BYWEEKNO"in c&&"BYMONTHDAY"in c);else if(1==o&&"BYDAY"in c)this.days=this.days.concat(this.expand_by_day(a));else if(2==o&&"BYDAY"in c&&"BYMONTH"in c){for(var q in this.by_data.BYMONTH)if(this.by_data.BYMONTH.hasOwnProperty(q)){var j=this.by_data.BYMONTH[q],v=ICAL.Time.daysInMonth(j,a);b.year=a,b.month=this.by_data.BYMONTH[q],b.day=1,b.isDate=!0;var x=b.dayOfWeek(),y=b.dayOfYear()-1;b.day=v;var z=b.dayOfWeek();if(this.has_by_data("BYSETPOS")){for(var A=[],B=1;B<=v;B++)b.day=B,this.is_day_in_byday(b)&&A.push(B);for(var C=0;C<A.length;C++)(this.check_set_position(C+1)||this.check_set_position(C-A.length))&&this.days.push(y+A[C])}else for(var D in this.by_data.BYDAY)if(this.by_data.BYDAY.hasOwnProperty(D)){var E,F=this.by_data.BYDAY[D],G=this.ruleDayOfWeek(F),H=G[0],I=G[1],J=(I+7-x)%7+1,K=v-(z+7-I)%7;if(0==H)for(var B=J;B<=v;B+=7)this.days.push(y+B);else H>0?(E=J+7*(H-1),E<=v&&this.days.push(y+E)):(E=K+7*(H+1),E>0&&this.days.push(y+E))}}this.days.sort(function(a,b){return a-b})}else if(2==o&&"BYDAY"in c&&"BYMONTHDAY"in c){var L=this.expand_by_day(a);for(var M in L)if(L.hasOwnProperty(M)){var B=L[M],N=ICAL.Time.fromDayOfYear(B,a);this.by_data.BYMONTHDAY.indexOf(N.day)>=0&&this.days.push(B)}}else if(3==o&&"BYDAY"in c&&"BYMONTHDAY"in c&&"BYMONTH"in c){var L=this.expand_by_day(a);for(var M in L)if(L.hasOwnProperty(M)){var B=L[M],N=ICAL.Time.fromDayOfYear(B,a);this.by_data.BYMONTH.indexOf(N.month)>=0&&this.by_data.BYMONTHDAY.indexOf(N.day)>=0&&this.days.push(B)}}else if(2==o&&"BYDAY"in c&&"BYWEEKNO"in c){var L=this.expand_by_day(a);for(var M in L)if(L.hasOwnProperty(M)){var B=L[M],N=ICAL.Time.fromDayOfYear(B,a),n=N.weekNumber(this.rule.wkst);this.by_data.BYWEEKNO.indexOf(n)&&this.days.push(B)}}else 3==o&&"BYDAY"in c&&"BYWEEKNO"in c&&"BYMONTHDAY"in c||(1==o&&"BYYEARDAY"in c?this.Line truncated
//# sourceMappingURL=ical.min.js.map