Customize

Check Times Are Within the Range

Summary

Check if the time in the specified time fields is within the specified range.

How to use

Check that the time in the specified fields is within the specified range. If it is not, an error will occur.

If any errors are found, a list of corresponding field codes will be provided. If all fields are correct, the result will be an empty list. If a specific field in the table is specified, the action will only keep the result for the last row of that table. The results from the other rows are not included, so please exercise caution.

Parameters

Set Field, Start Time, End Time, Whether to check with date, and Error Message.

Field

Select which field to check.

  • When selecting multiple fields, each of those fields will be checked individually.
  • If you select a field inside a table, all rows of that table will be processed. For exceptions: See (*1)

*1: If you set a Condition that only applies to some table rows (such as the Condition “When Fields Value Changed”), the value will be set only for those affected by that Condition.

This parameter accepts the following field types:

  • Time
  • Date and time

Start Time

Enter the start time of the time range.

End Time

Enter the end time of the time range.

Whether to check with date

Specify whether to check the range, including the dates, when the field value, Start Time, and End Time include a date.

In the case of “Compare only the time part,” even if the date is present in the field value, Start Time, and End Time, the date portion will be disregarded and only the time part will be compared.

For instance, if the field value is “2019-11-17 10:00,” the Start Time is “2019-11-18 08:00,” and the End Time is “2019-11-20 18:00,” using the “Compare with date” option will generate an error since the date is out of range. However, if the “Compare only the time part” option is selected, it will compare “10:00” with the time range of “08:00 to 18:00,” which will not result in an error.

In the case of “Compare with date,” the method of checking changes depending on whether the date is included in each of the field value, Start Time, and End Time.

  • Compare only the time part:
    Ignore all dates included in the field value, Start Time, and End Time, and compare only the time part.
  • Compare including the date:
    • If the field Value, Start Time, and End Time all include a date:
      Compare including the date.
    • If the field value includes a date, and the Start Time and End Time do not include any date:
      Compare only the time.
    • If the field value includes a date, and only one of the Start Time, and End Time includes a date:
      Any date not included in the Start Time or End Time is considered the same as the included date.
    • If the field value does not contain a date:
      Ignore the date part of the Start Time and End Time, and compare only the time.

If the Start Time is later than the End Time, caution is necessary.

  • Selecting the “Compare only the time part” option may result in errors if the time falls within the range of “End Time < field value < Start Time.”
    • For example, if a time range spans across dates, such as a Start Time of “23:00” and an End Time of “01:00,” the following rules apply:
      • The time range “00:00 to 01:00” is OK.
  • The time range “01:01 to 22:59” is an error.
  • The time range “23:00 to 23:59” is OK.
  • When “Compare with date” is selected, an error will always occur.

Error Message

Enter an error message to display if an error is detected.

Compatibility with krewSheet

The action is supported only under the following conditions:

You cannot set multiple errors at the same time. The error set last will be displayed in the krewSheet.