DateTimeClinical
BasicClinical values
<co-date-time-clinical>DateTimeClinical shows dates as MM/DD/YYYY, times in 12- or 24-hour form with an optional zone, and ages from date of birth down to days for newborns, plus gestational age.
import { DateTimeClinical } from 'health-components';
Examples
Dates And Times
Ages
Obstetrics
Prefix And Relative
Usage
<DateTimeClinical mode="dob" value="2026-08-28" asOf="2026-10-09" />
When to use
- Every date, time, DOB and age on a clinical screen.
When not to use
- Date entry: DatePicker.
- Relative-only times ("5 min ago") with no absolute time.
Variants and states
| Variant | What it is |
|---|---|
| date | 03/14/2026. |
| time | 02:05 PM, or 14:05 with hour24. |
| datetime | Date and time; zone abbreviation when timeZone is set. |
| dob | DOB with age: 03/14/1979 (47 y). |
| age | Age only: 8 d, 6 wk, 9 mo, 47 y. |
| gestational | GA 38w 4d from weeks and days or EDD. |
Accessibility
- Renders a
<time>element with an ISO datetime attribute. - Age has a title with the long form ("6 weeks").
Do and don't
- Do: Pass
timeZonefor anything across sites or telehealth. - Don't: Show a two-digit year.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | Date | — | Date value: ISO string ('2026-10-09' is a calendar date) or Date; required except in 'gestational' mode |
mode | DateTimeClinicalMode | 'date' | 'date' (MM/DD/YYYY) | 'time' | 'datetime' | 'dob' (date and age) | 'age' | 'gestational' |
hour24 | boolean | false (12-hour) | 24-hour time |
timeZone | string | the browser zone | IANA zone; shows the zone abbreviation with times |
asOf | string | Date | today | Date the age or gestational age is computed at |
weeks | number | none | Gestational age weeks |
days | number | 0 | Gestational age days |
edd | string | none | Estimated due date; gestational age is computed from it when set |
prefix | string | none | Text before ('Admitted') |
relative | string | none | Relative text after ('2 h ago') |
Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, plus className and event handlers on the root element.
Angular, Vue and HTML
Register the elements once (Angular guide), then use <co-date-time-clinical>. Attributes take strings; arrays and objects are set as properties (Angular [prop], Vue :prop) or as JSON attributes. Callbacks are DOM events with the value in event.detail.
Angular template
<co-date-time-clinical mode="…" hour24 [value]="value"></co-date-time-clinical>
| Kind | Name | Description |
|---|---|---|
| property / JSON attribute | value | Date value: ISO string ('2026-10-09' is a calendar date) or Date; required except in 'gestational' mode |
| attribute | mode | 'date' (MM/DD/YYYY) | 'time' | 'datetime' | 'dob' (date and age) | 'age' | 'gestational'; default 'date' |
| attribute | hour24 | 24-hour time; default false (12-hour) |
| attribute | time-zone / timeZone | IANA zone; shows the zone abbreviation with times; default the browser zone |
| property / JSON attribute | as-of / asOf | Date the age or gestational age is computed at; default today |
| attribute | weeks | Gestational age weeks; default none |
| attribute | days | Gestational age days; default 0 |
| attribute | edd | Estimated due date; gestational age is computed from it when set; default none |
| attribute | prefix | Text before ('Admitted'); default none |
| attribute | relative | Relative text after ('2 h ago'); default none |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus |