---
title: Split an EDI date-range string
summary: Split a delimited EDI date-range token into start and end DateTimes.
status: draft
owner: saif-docgen
last_reviewed: 2026-09-15
library: SAIF.Framework.Common
reference_type: package
operation_id: OP-011
trigger: Caller parses a `yyyymmdd-yyyymmdd` token
---

# Split an EDI date-range string

Split a delimited EDI date-range token into start and end DateTimes, triggered when caller parses a `yyyymmdd-yyyymmdd` token.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-011 |
| **Trigger** | Caller parses a `yyyymmdd-yyyymmdd` token |
| **Inputs** | `dateString` |
| **Outputs** | `out startDate`, `out endDate` |
| **Primary components** | ``DateMaker.ExtractDateRange(string dateString, out DateTime startDate, out DateTime endDate)`` |
| **Entry point** | `Common/SAIF.Common/Classes/DateMaker.cs` |

## Steps

1. Split the input on the `DateSeperator` constant (`'-'`). ([BR-030](../business-rules.md#br-030-edi-file-date-strings-use-the-yyyymmdd-format-and-the---separator-between-a-start-and-an-end-date))
2. Convert element 0 to `startDate` via `MakeDateTime` (OP-010). ([BR-028](../business-rules.md#br-028-in-edi-date-parsing%2C-a-6-character-date-is-a-2-digit-year-and-is-always-treated-as-21st-century), [BR-029](../business-rules.md#br-029-a-short-edi-time-string-is-right-padded-with-zeros-to-hh24miss))
3. Convert element 1 to `endDate` via `MakeDateTime` (OP-010). ([BR-028](../business-rules.md#br-028-in-edi-date-parsing%2C-a-6-character-date-is-a-2-digit-year-and-is-always-treated-as-21st-century), [BR-029](../business-rules.md#br-029-a-short-edi-time-string-is-right-padded-with-zeros-to-hh24miss))

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start(["Caller parses a<br>yyyymmdd-yyyymmdd token"]) --> S1["Split input on<br>DateSeperator constant ('-')"]
	S1 --> S2["Convert element 0 to<br>startDate via MakeDateTime"]
	S2 --> D1{"Second element present?"}
	D1 -->|No| X1(["IndexOutOfRangeException"])
	D1 -->|Yes| S3["Convert element 1 to<br>endDate via MakeDateTime"]
	S3 --> End(["startDate and endDate<br>returned"])
```

## Failure and edge-case behavior

- A single-date input with no delimiter raises `IndexOutOfRangeException` at step 3.*

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.

## Sources
- `Common/SAIF.Common/Classes/DateMaker.cs`
