Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ical: leave type #502

Open
christopheg opened this issue Dec 3, 2021 · 4 comments
Open

ical: leave type #502

christopheg opened this issue Dec 3, 2021 · 4 comments

Comments

@christopheg
Copy link

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?

@attilabalazsy
Copy link

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

@christopheg
Copy link
Author

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

@gerryd
Copy link

gerryd commented Aug 10, 2022

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!

@attilabalazsy
Copy link

@gerryd feel free to use it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants