Function: parseDate()
parseDate(
raw):object
Decode a single DA value. legacy is true for any tolerated
non-canonical form (retired dotted YYYY.MM.DD, or an unparseable value
such as "ANONYMIZED"), signalling the caller to emit
DICOM_DA_LEGACY_FORMAT.
Parameters
raw
string
Returns
object
legacy
legacy:
boolean
value
value:
DicomDate
Example
import { parseDate } from "@cosyte/dicom";
parseDate("20240115").value.valid; // true
parseDate("2024.01.15").legacy; // true