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; } | |