mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-14 02:02:19 +00:00
add name property to cal, use forked node-icalendar
This commit is contained in:
parent
39babb4bb5
commit
5d372dbe75
1 changed files with 2 additions and 1 deletions
|
|
@ -20,6 +20,7 @@ module.exports.API = ->
|
|||
return res.send(500, "No events found") if _.isEmpty(tasksWithDates)
|
||||
|
||||
ical = new icalendar.iCalendar()
|
||||
ical.addProperty('NAME', 'HabitRPG')
|
||||
_.each tasksWithDates, (task) ->
|
||||
event = new icalendar.VEvent(task.id);
|
||||
event.setSummary(task.text);
|
||||
|
|
@ -27,7 +28,7 @@ module.exports.API = ->
|
|||
d.date_only = true
|
||||
event.setDate d
|
||||
ical.addComponent event
|
||||
res.type('ics')
|
||||
res.type('text/calendar')
|
||||
formattedIcal = ical.toString().replace(/DTSTART\:/g, 'DTSTART;VALUE=DATE:')
|
||||
res.send(200, formattedIcal)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue