# Dates Compare Condition & Validator

The **Dates Compare Condition and Validator** let you validate workflow transitions based on date comparisons. They allow you to compare one date field against another date field or the current date, with optional offsets for maximum flexibility. Transitions are only allowed if the configured date criteria are met.

<figure><img src="https://4067441311-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fh6orV4J25NOSJvrMyLKk%2Fuploads%2FGF3TV4BoHDtvhHZNlQ0p%2FDates_compare_condition.png?alt=media&#x26;token=958913bb-9807-4f68-84e8-f7020fd511e1" alt="" width="563"><figcaption><p>Example 1. Allow transition if difference between two fields is less than 45m</p></figcaption></figure>

## Settings

All Jira Date and Date Time fields, including custom fields, are available for comparison. Additionally, the **now()** option is available in Date reference, which represents the current date or time.

Depending on the **Compare including time part** checkbox, fields will be converted to either date or datetime format. If the field doesn't have a time part, T00:00:00+00:00 will be used (UTC timezone).&#x20;

### Entering offset

You can enter an offset in weeks (w), days (d), hours (h), and minutes (m), which will be added to the date. Use - as a prefix for subtraction.&#x20;

Time units will be used only if the **Compare including time part** setting is checked.

## Use cases

<details>

<summary>Allow transition if difference between two fields is less than 45m</summary>

1. In Date field: select **Stop time**
2. In Operator: select **<**
3. In Date reference: **Start time**
4. In Offset: set +**45m**
5. Check: **Compare including time part**

</details>

<details>

<summary>Verify that 'Due date' is not less than 5 days from now</summary>

1. In Date field: select **Due date**
2. In Operator: select **>=**
3. In Date reference: **now()**
4. In Offset: set **5d**

</details>

<details>

<summary>Allow transition only if the 'Actual end' date occurs before the 'Planned end' date</summary>

1. In Date field: select **Actual end**
2. In Operator: select **<**
3. In Date reference: select **Planned end**

</details>

<details>

<summary>Prevent transition until the specified change window opens, as indicated by the 'Start date' field.</summary>

1. In Date field: select **Start date**
2. In Operator: select **<=**
3. In Date reference: select **now()**

</details>

<details>

<summary>Allow transition only if 'Due date' is not in the past</summary>

1. In Date field: select **Due date**
2. In Operator: select **>=**
3. In Date reference: **now()**

</details>
