timeoff-management-application icon indicating copy to clipboard operation
timeoff-management-application copied to clipboard

ical: leave type

Open christopheg opened this issue 4 years ago • 4 comments

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?

christopheg avatar Dec 03 '21 08:12 christopheg

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 image

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('. ')} : '' ), });

attilabalazsy avatar Jul 26 '22 08:07 attilabalazsy

Hi @attilabalazsy, Thanks for this! Would there be any chance that one of the maintainers includes this in the next version? (@vpp)

christopheg avatar Aug 01 '22 15:08 christopheg

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 avatar Aug 10 '22 08:08 gerryd

@gerryd feel free to use it!

attilabalazsy avatar Aug 10 '22 16:08 attilabalazsy