Home      Ask a Question      My Stuff      Help   
  
Scripting - Floating Holidays
This article will show the easiest way for scripting to check for a specific date.

Sometimes we have specific dates that we would like to recognize as Holidays that have not been included in the system or days that we want to have other specific things happen. Here is an example of checking for a specific date and changing the category to Holiday:

if (dateadd("m", 0, "12/26/2011") = punchdate)
{
category = "Holiday";
payrate = payrate * 1.5;
}

You can also schedule multiple dates using a "variable", or name, to group the holidays together. You can tag the dates with comments using something like "//Memorial Day Eve" (no quotes). See below:

IsDayBeforeHoliday = (
(dateadd("m", 0, "05/29/2011") = punchdate) or //Memorial Day Eve
(dateadd("m", 0, "11/23/2011") = punchdate) or //Thanksgiving Eve
(dateadd("m", 0, "12/24/2011") = punchdate) or //Christmas Eve
(dateadd("m", 0, "12/31/2011") = punchdate) ); //New Years Eve

Next you would just do a script against your "IsDayBeforeHoliday" variable like in the following example:

if (IsDayBeforeHoliday)
{
category = "Holiday";
payrate = payrate0 + 1;
}
ID
577
Category
Training
  FAQ's
Date Created
6/1/2011 2:39:22 PM
Date Updated
4/24/2012 1:49:01 PM
Back to Search Results