Views:

Product: LABELVIEW, CODESOFT

Version: All Versions

 


shiftcode(«items», «defaultValue»):The Shift code is used as a data source for a field on the label that needs to change based upon the current time. A shift represents a span of time that is defined and named.

Return value

String

Returns the current shift code value.  

items

String

Shift code items in the following format:  startHour:startMin-stopHour:StopMin-value|...| startHour:startMin-stopHour:StopMin-value


For example, shifts could be defined as follows:

  • 7:00 to 15:00 = Day
  • 15:00 to 23:00 = Evening
  • 23:00 to 7:00 = Night

Notes:
1. The 24-hour clock is used to define time values. 0:00 is midnight; 12:00 is midday.
2. If there are any time overlaps in input then the first acceptable value is returned.
3. If there is no shift for the current time then an empty string is returned.

Example: (if current time is 16:00):
shiftcode("7:00-15:00-Day|15:00-23:00-Evening|23:00-7:00-Night","Day")  =''Evening''