On this page
@addTagHelper *, Webority.Ui.RazorStates
Each date reads against today in India: overdue in danger, days left in warning, and the plain date for the rest.
Past, soon and later
Overdue
Mark a date overdue from your own rule, and give it words when the date means something else.
Overdue, with its own label
Wording and glyph
Due wording reads a near date the way a task list does, and the glyph sits before any date.
Today, tomorrow and later
Every option
Every value of every prop, one cell each.
date: the forms it takes
date: a DateOnly
date: an ISO string or epoch milliseconds, React only
date omitted: Not set
soonDays: a number of days
soon-days="7"
soon-days omitted: the plain date
overdue: off or on
overdue="false" (default)
overdue="true"
overdueLabel: the words when overdue
overdue-label omitted (default)
overdue-label="Validity ended"
soonWording: days or due
soon-wording="days" (default)
soon-wording="due"
icon: off or on
icon="false" (default)
icon="true"
notSetLabel: the words with no date
not-set-label="Not set" (default)
not-set-label="No date set"
dueTodayLabel: the words for today
due-today-label="Due today" (default)
due-today-label="Today"
dueTomorrowLabel: the words for tomorrow
due-tomorrow-label="Due tomorrow" (default)
due-tomorrow-label="Tomorrow"
dueInLabel: the words for a later day
due-in-label="Due in {days} days" (default)
due-in-label="{days} days to go"
daysLeftLabel: the words for the days left
days-left-label="{days} days left" (default)
days-left-label="{days} days remaining"
oneDayLeftLabel: the words for one day left
one-day-left-label="1 day left" (default)
one-day-left-label="1 day remaining"
overdueSinceLabel: the words when overdue
overdue-since-label="Overdue since {date}" (default)
overdue-since-label="Lapsed on {date}"
className: an extra class
class: an extra class (fw-semibold)
Guidance
What to do, and what to avoid.
Use it when
- A date is a deadline someone must meet: a task due date, a milestone, the end of a validity period.
- Lists, boards and detail pages where the date should read as on time or late.
Reach for something else when
- A moment that already happened, such as created or updated. → AppRelativeTime
- A date that is only a fact, with no deadline. → A formatted date
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
14 props. The 5 most used come first.
Used on most screens 5 props
| Prop | Type | Default | Description |
|---|---|---|---|
| datedefault - | DateOnly | - | The due date: an ISO date or date-time string, or epoch milliseconds, read in India Standard Time. |
| soon-daysdefault - | int | - | Within this many days of the date, the text reads "N days left" in warning. |
| icondefault false | bool | false | Draws a calendar glyph before the date text in every dated state. |
| overduedefault false | bool | false | Set by the caller from its own rule. Done items are never overdue. |
| overdue-labeldefault - | string | - | Replaces the date text when overdue, for example "Validity ended". |
Less common 9 props
| Prop | Type | Default | Description |
|---|---|---|---|
| soon-wordingdefault days | days | due | days | Within soonDays, "days" reads "N days left"; "due" reads "Due today", "Due tomorrow" or "Due in N days". |
| not-set-labeldefault Not set | string | Not set | Replaces the built-in English text, for other languages. |
| due-today-labeldefault Due today | string | Due today | Replaces the built-in English text, for other languages. |
| due-tomorrow-labeldefault Due tomorrow | string | Due tomorrow | Replaces the built-in English text, for other languages. |
| due-in-labeldefault Due in {days} days | string | Due in {days} days | Replaces the built-in English text, for other languages. The token {days} is the number of days left. |
| overdue-since-labeldefault Overdue since {date} | string | Overdue since {date} | Replaces the built-in English text, for other languages. The token {date} is the formatted due date. |
| days-left-labeldefault {days} days left | string | {days} days left | Replaces the built-in English text, for other languages. The token {days} is the number of days left. |
| one-day-left-labeldefault 1 day left | string | 1 day left | Replaces the built-in English text, for other languages. |
| classdefault - | string | - | Extra class on the root, added to the component's own. |
Screen reader
3 notes- The date sits in a time element that carries the machine readable date.
- An overdue date has the title Overdue since the date and a danger glyph beside the text, so the state does not rest on colour alone.
- A missing date reads Not set, in muted text.