@coozzy/cal-dav
Advanced tools
Comparing version 2.4.19 to 2.4.20
@@ -147,3 +147,5 @@ "use strict"; | ||
const descriptionProperty = new ICAL.Property('description'); | ||
descriptionProperty.setValue((0, _htmlToText.htmlToText)(description)); | ||
descriptionProperty.setValue((0, _htmlToText.htmlToText)(description, { | ||
preserveNewlines: true | ||
})); | ||
// descriptionProperty.setParameter('ALTREP', 'data:text/html,' + (description || '')); | ||
@@ -402,3 +404,5 @@ event.component.addProperty(descriptionProperty); | ||
const descriptionProperty = new ICAL.Property('description'); | ||
descriptionProperty.setValue((0, _htmlToText.htmlToText)(description)); | ||
descriptionProperty.setValue((0, _htmlToText.htmlToText)(description, { | ||
preserveNewlines: true | ||
})); | ||
// descriptionProperty.setParameter('ALTREP', 'data:text/html,' +( description || '')); | ||
@@ -598,3 +602,6 @@ event.component.addProperty(descriptionProperty); | ||
_logger.default.debug(`${method}: ${events.length} events successfully parsed.`); | ||
return events; | ||
const sortedEvents = events.sort((a, b) => { | ||
return a.startDate.toUnixTime() - b.startDate.toUnixTime(); | ||
}); | ||
return sortedEvents; | ||
}; | ||
@@ -601,0 +608,0 @@ this.service = service || new _caldavService.DefaultCalDavService(username, password, calendarUrl); |
{ | ||
"name": "@coozzy/cal-dav", | ||
"version": "2.4.19", | ||
"version": "2.4.20", | ||
"description": "Simple cal dav client.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -6,3 +6,3 @@ import * as ICAL from 'ical.js'; | ||
import logger from '@coozzy/logger'; | ||
import {AttendeeStatus, EventFrequencyCalendarService} from '../types/calendar'; | ||
import { EventFrequencyCalendarService} from '../types/calendar'; | ||
import {htmlToText} from 'html-to-text'; | ||
@@ -219,3 +219,3 @@ | ||
const descriptionProperty = new ICAL.Property('description'); | ||
descriptionProperty.setValue(htmlToText(description)); | ||
descriptionProperty.setValue(htmlToText(description, {preserveNewlines: true})); | ||
// descriptionProperty.setParameter('ALTREP', 'data:text/html,' + (description || '')); | ||
@@ -511,3 +511,3 @@ event.component.addProperty(descriptionProperty); | ||
const descriptionProperty = new ICAL.Property('description'); | ||
descriptionProperty.setValue(htmlToText(description)); | ||
descriptionProperty.setValue(htmlToText(description, {preserveNewlines: true})); | ||
// descriptionProperty.setParameter('ALTREP', 'data:text/html,' +( description || '')); | ||
@@ -514,0 +514,0 @@ event.component.addProperty(descriptionProperty); |
2485
126661