Hey! I was tasked by our HR team to find a way of automating how we currently complete our Parental Leave Calendar. I started using Apps Script despite only knowing the very basics of Javascript and obviously struggled pretty early on. I queried a few steps on Chat GPT and it implemented these changes well and it seemed to be going really smoothly. I then started to ask it to do a few more complex things and it gave a very convincing answer and then something went wrong. I’ve tried undo’ing various steps and changing various things and it just won’t work. A friend recommended asking this forum so I thought I would see if actual people with Javascript knowledge could help me instead of AI!
So my main objectives are:
-
To create a fully automated (colour coded) parental leave calendar so that one of our employees can simply select dates, and it then generates their full parental leave calendar (they can also play around with these dates and it will refresh every time).
-
The dates that they need to select are: The date that they wish to start their parental leave (start date), their due date, their birthday (as this gives us their additional days off that they’re entitled to), they need to select how many days off they have on their current annual leave (Current years leave left), and the number of days that they would like to use from next years annual leave (Days of next years leave to use).
-
The calendar needs to be split out over multiple tabs (each tab representing a month of the year and reflect which year it belongs to).
-
The calendar itself needs to show the first 13 weeks at 100% pay, the second 13 weeks at 50% pay, the next 13 weeks at SMP, and then 13 weeks unpaid - these are all colour coded. It also needs to display weekend dates as non-working days. The calendar also needs to highlight the following: Due date, Bank Holiday days, non working days, and the return date. It also needs to account for the untaken annual leave, accumulated bank holidays, birthday(s), and any leave to be taken from next years allowance. These also need to be colour coded, and added on between the last day of the 13 weeks unpaid, and before the return date. If a birthday occurs twice during this parental leave, there would need to be 2 days added instead of one. Ideally I would also like completely different pastel colours for everything to make it look nice.
-
I would also like the parental leave calendar to refresh each time and not retain any colour coded dates that were inputted beforehand. It also needs to account for the date timeframe that the employee enters.
-
I would like the tab in sheets to be titled “Parental Leave Calendar”, the next option to be titled “Choose Dates”, and then the pop up to be called “Please Select”. I would also like this pop up to look more visually pleasing than it currently does.
The next couple of things aren’t a necessity, but would be very beneficial, but I would like the following:
-
Have a facility where if the employee doesn’t want to take unpaid/SMP/50% pay then they can easily remove this.
-
Where we have the drop down asking about start date, due date, birthday, current years leave left and days of next years leave to use - I would really like a tick box asking if they have a sabbatical they would like to use. If this box is ticked, then I would like it to ask the employee how many days of their sabbatical they would like to use and reflect this at the end of their time off, before their return date.
This seems to me like an impossible task, but I’m sure someone somewhere might be able to help - or tell me that is an impossible task so that I can stop swearing at Chat GPT telling me the next ‘simple step’ that never works!
I’ll post what I currently have in a sec (I apologise in advance for anything that looks hideous - I am still learning):