Calculating Weekends and Government holidays in Calendar?

0
I have Calculated SLA which includes all Holidays and Weekends but according to my requirement I should not include Holidays and weekends. I need to filter all weekends and Holidays in calendar then I need to proceed with calculating SLA. So, could you please help me that how to filter Holidays and weekends in a calendar? NOTE: Holidays should be configurable and it should carried out by super admin. Thanks in Advance!
asked
3 answers
1

Hi Arun,

  1. Create an entity and their overview pages to store holidays which can be accessible only by Super Admin.
  2. As lennart mentioned , we can check weekends by finding day of the week like below

       formatDateTime($date,'EEE')='Sat'  or  formatDateTime($date,'EEE')='Sun'

 When you are calculating SLA, check your date belongs to any holidays which is already stored in database or whether it is a weekend or not. In this way you can exclude them all in calculation.


 

answered
0

It would probably be easiest to use one of the many API's available out there, to get the holidays for your selected county into your database. Weekends are easier because you can check the day of week with the formatDateTime function in a microflow. Store them all as calendar events in your database and add a screen where the admin can edit the holidays. Something like that?

answered
0

There is a learning path with a holiday per country retrieving application doing a bit of what you need: https://academy.mendix.com/link/path/104/Logging-1

You can download the .mpk from here and use that code as a base for your module that is handling the holidays

answered