Home      Ask a Question      My Stuff      Help   
  
TimeWorks Plus: Scripting Based on the Day of the Week
Because of Processing Rules, there are areas in which the selected scripts need to be. Nonetheless, the rules in TimeWorks Plus and TimeWorks are the same.

The general script format is:

if ("Day(s) of the Week" contains weekday (reportingdate))
{
Then Do Something;
}

"Day(s) of the Week" are set to be:

M- Monday
T- Tuesday
W- Wednesday
R- Thursday
F- Friday
S- Saturday
U- Sunday

Doing mutliple days requires a list of the variables in quotes. For example "MTW" would be Monday, Tuesday and Wednesday.

Below are examples:

1. Script Processing Rule:


if ("U" contains weekday (cdate(indt)))
{
category = "Sunday";
}

You can combine multiple days like this:

if ("MTWRF" contains weekday (cdate(indt)))
{
category = "Week Days";
}

This would apply whatever the stated action to Monday through Friday.

2. PayRateScript Processing Rule:

Another example would be if there is a rate change for a particular day. In this example we will use Thursday and state that if it is Thursday they get time and a half (x1.5) for any hours worked that day:

if ("R" contains weekday (reportingdate.date))
{
payrate = payrate * 1.5;
}


3. RoundScript Processing Rule:

Rounding can also be made conditional based on the day:

if ("MTWRF" contains weekday (cdate(indt)))
{
round ("05:00am - 08:20am = 08:20am");
}

This states that if it is a weekday (M-F) then apply the rounding rule.
ID
811
Category
<Unassigned>
Date Created
1/21/2013 7:24:40 AM
Date Updated
10/28/2014 2:50:27 PM
Back to Search Results