ical: leave type
Hi,
I'm using the ical to see the team calendar in thunderbird. We have defined different 'leave types' (ex 'work from home'). It would be great to see this leave type via ical. Currently I don't see any difference between a 'work from home' and an actual holiday.
Is that something that could be added?
Hi @christopheg,
I made an unofficial change in my local copy to achieve the same, it requires only couple of lines of code.
timeoff-management-application\lib\route\feed.js

const comments = await getCommentsForLeave({leave: day.leave_obj});
// Incorporate the leave type into the event title instead of the hardcoded ' is OOO (out of office)' var typeStr = day.leaveLabel.toLowerCase(); const indx = typeStr.indexOf('('); if(indx > -1){ typeStr = typeStr.substr(0, indx - 1); } typeStr = ' (' + typeStr + ')';
cal.createEvent({
start : start.toDate(),
end : end.toDate(),
allDay : allDay,
summary : day.user.full_name() + typeStr, //' is OOO (out of office)',
description: (comments.length > 0
? With comments: ${comments.map(({comment}) => comment).join('. ')}
: ''
),
});
Hi @attilabalazsy, Thanks for this! Would there be any chance that one of the maintainers includes this in the next version? (@vpp)
Hi @attilabalazsy,
I made an unofficial change in my local copy to achieve the same, it requires only couple of lines of code.
Hi attilabalazsy,
Thank you for the patch!
Can I have your permission to include it in our Docker image? The patch I made based on your suggestion is here:
https://github.com/tigron/docker-timeoff-management/blob/50efb4b9df440486b1b6f2f029699062b0d1b513/patches/20220810-ical-leave-type.patch
Thanks again!
@gerryd feel free to use it!