Calculate duration based on schedule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2014 03:20 AM
I need to be able to calculate the difference between two date fields in days based on a schedule (business days). E.g. If start date is 01/03/2014 and end date is 08/03/2014, I want this answer to be 5 days (as 2 days out of the 7 are weekend days).
There is a mention of this on the Wiki but it talks about packages.com and doesn't seem to work.
I have also seen 'GlideSchedule' referenced but not how to use it.
Has anyone got any thoughts please? Your help would be much appreciated.
- Labels:
-
Service Mapping

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2014 02:36 PM
I built this and tested it on a demo instance. I would probably have it trigger from the end_date variable since you probably need to fill in both the start_date and end_date variables.
Let me know if you have additional questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2014 01:39 AM
Hi,
I am working with Davina. If you are able to reply to her message, that would be really helpful. We are really keen to make this work and appreciate the help.
Many thanks,
Madeleine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2015 07:53 AM
I am trying your above code on my demo instance but some how its not working. mine is scoped application.
I am unable to insert formatted code, so i am posting screen shot.
any thoughts why its not working?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2015 10:38 AM
I built this solution based upon the input format (mm/dd/yyyy) being different than the default date format of yyyy-mm-dd. If your dates are different than this, you need to adjust the _convertDate function. Let me know what you are passing for the start and end dates so I can adjust accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2016 01:19 AM
I've got the same error, did you figure a way to overcome this?