---
title: "Reject a reversed date interval"
description: "Test a form whose end date must follow its start date, including correcting one field while preserving the other entered values."
canonical_url: "https://vostride.com/agent-library/forms-validation/cross-field-date-order.md"
md_url: "https://vostride.com/agent-library/forms-validation/cross-field-date-order.md"
content_kind: "recipe"
topic: "forms-validation"
---

# Reject a reversed date interval

Test a form whose end date must follow its start date, including correcting one field while preserving the other entered values.

## Risk

Checking individual dates is insufficient when their relationship is invalid. A form may accept two parseable values that describe an impossible interval or attach its message to the wrong field.

## Fixtures

- A test-only maintenance calendar allows a new window named QA overnight inspection.
- The form contract requires end time later than start time in the displayed UTC timezone.
- The initial calendar inventory contains no window with this unique name or fixture marker.

## Steps

1. Open the new maintenance-window form and enter the fixture name, start June 12 at 18:00 UTC, and end June 12 at 17:00 UTC.
2. Submit and verify a visible interval-order error explains that the end must be after the start.
3. Verify the name and both entered date values remain available for correction and no calendar event has appeared.
4. Change only the end to June 12 at 19:00 UTC and submit again.
5. Open the created calendar event and verify its name, UTC start, UTC end, and one-hour duration agree with the independent fixture expectations.

## Expected results

- The invalid interval creates no maintenance event in the calendar inventory.
- The corrected event spans exactly 18:00 through 19:00 UTC on the selected day.
- The original name and start time survive the rejected submission without unintended normalization.

## False-pass traps

- A generic red border without readable relation guidance does not establish the expected error.
- Checking only the displayed duration can miss a shifted timezone that moved both endpoints.

## Cleanup

- Delete the created maintenance window and any unexpected event carrying its unique marker.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa first test](/docs/agent-qa/guides/first-test.md)
- [agent-qa web testing](/docs/agent-qa/guides/web-testing.md)

- [Forms and validation QA recipes](/agent-library/forms-validation.md)
- [Software factory QA library](/agent-library.md)
