Date Editors
<oge-calendar> is a standalone month/year/decade calendar; <oge-date-box> puts it behind a field with locale-aware text parsing. Everything runs on native Date + Intl — no date library, no adapter, and all day math is local (never Date.parse), so values can't drift across timezones.
Calendar
WAI-ARIA date grid with a roving-tabindex day: arrows move ±1/±7 days, PgUp/PgDn ±1 month (Shift ±1 year), Home/End week edges. The header drills out to year and decade views. min/max/disabledDates gate selection; week numbers follow a configurable rule.
Sat Aug 15 2026import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
import { OgeCalendar } from '@oge-ui/inputs';
@Component({
selector: 'demo-root',
imports: [OgeCalendar],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<oge-calendar [(value)]="date" />
<oge-calendar
[min]="min"
[disabledDates]="isWeekend"
[showTodayButton]="true"
[showWeekNumbers]="true"
[firstDayOfWeek]="1"
[(value)]="date"
/>
`,
})
export class Demo {
protected readonly date = signal<Date | null>(null);
protected readonly min = new Date(2026, 0, 1);
protected readonly isWeekend = (day: Date): boolean =>
day.getDay() === 0 || day.getDay() === 6;
}Date Box
The value is always a local Date | null — serialization is the app's concern. Typed text parses by the locale's own part order (dd/mm vs mm/dd) incl. month names; unparseable or out-of-range text shows the invalid state and reverts on blur — a wrong date is never committed. The popup follows the APG date-picker-dialog pattern: focus moves into the calendar, Esc returns it.
import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
import { OgeDateBox } from '@oge-ui/inputs';
@Component({
selector: 'demo-root',
imports: [OgeDateBox],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<oge-date-box label="Start date" [(value)]="start" />
<!-- typed text parses locale-aware through Intl — never Date.parse -->
<oge-date-box
label="Delivery"
[min]="today"
[showClearButton]="true"
[(value)]="delivery"
/>
`,
})
export class Demo {
protected readonly start = signal<Date | null>(null);
protected readonly delivery = signal<Date | null>(null);
protected readonly today = new Date();
}Range selection
selectionMode: 'range' turns the calendar into a start–end picker with a live hover preview; viewsCount: 2 lays two months side by side. <oge-date-range-box> puts the same picker behind a single field with two parsed inputs — a reversed pair reorders on commit, either end may stay open. type: 'datetime' adds start/end time lists: day and time picks collect in a draft and commit together on OK.
Mon Aug 10 2026 → Thu Aug 20 20268/14/2026, 10:00:00 PM → 8/15/2026, 6:30:00 AMimport { ChangeDetectionStrategy, Component, signal } from '@angular/core';
import { OgeCalendar, OgeDateRangeBox } from '@oge-ui/inputs';
import type { OgeCalendarRange } from '@oge-ui/inputs';
@Component({
selector: 'demo-root',
imports: [OgeCalendar, OgeDateRangeBox],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<!-- two-view range calendar with hover preview -->
<oge-calendar selectionMode="range" [viewsCount]="2" [(range)]="range" />
<!-- start–end on one field; typed or picked, reversed pairs reorder -->
<oge-date-range-box label="Period" [(value)]="period" />
<!-- datetime range: start/end time lists + OK, commits as a draft; two
date-times need a wider field than the 240px default -->
<oge-date-range-box type="datetime" [interval]="30" width="min(100%, 360px)" [(value)]="window" />
`,
})
export class Demo {
protected readonly range = signal<OgeCalendarRange>([null, null]);
protected readonly period = signal<OgeCalendarRange>([null, null]);
protected readonly window = signal<OgeCalendarRange>([null, null]);
}Time & datetime
type switches the editor: time shows a time picker (clock rail icon), datetime pairs it with the calendar — picking a date keeps the popup open for the time. timeView selects the picker layout: one interval list, or iOS-style hour + minute columns. applyValueMode: 'useButtons' collects picks in a draft and commits on OK.
import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
import { OgeDateBox } from '@oge-ui/inputs';
@Component({
selector: 'demo-root',
imports: [OgeDateBox],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<!-- one interval list (default) … -->
<oge-date-box type="time" timeView="list" [interval]="30" [(value)]="t1" />
<!-- … or hour + minute columns -->
<oge-date-box type="time" timeView="columns" [interval]="5" [(value)]="t2" />
`,
})
export class Demo {
protected readonly t1 = signal<Date | null>(null);
protected readonly t2 = signal<Date | null>(null);
}Clock, seconds & shortcuts
hour12: true adds an AM/PM column to the column picker (hours 12, 1 … 11); false forces 24-hour; unset follows the locale. showSeconds adds a seconds column and shows the seconds in the field — typed HH:MM:SS parses. showTodayButton / showNowButton put Today and Now in the footer: Today keeps the time of day, Now commits the current time.
import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
import { OgeDateBox } from '@oge-ui/inputs';
@Component({
selector: 'demo-root',
imports: [OgeDateBox],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<!-- hour12: true adds an AM/PM column (hours 12, 1 … 11); showSeconds
adds a seconds column and puts the seconds in the display text. -->
<oge-date-box
label="Departure"
type="time"
timeView="columns"
[hour12]="true"
[showSeconds]="true"
[showNowButton]="true"
[(value)]="departure"
/>
<!-- Today / Now footer shortcuts; Today keeps the time of day -->
<oge-date-box
label="Logged at"
type="datetime"
[showTodayButton]="true"
[showNowButton]="true"
[(value)]="loggedAt"
/>
`,
})
export class Demo {
protected readonly departure = signal<Date | null>(new Date(2026, 7, 15, 18, 45, 0));
protected readonly loggedAt = signal<Date | null>(null);
}Masked entry
useMaskBehavior swaps free typing for segments in the locale's own order and separators (dd.mm.yyyy in de-DE, mm/dd/yyyy, hh:mm -- in en-US): digits fill the selected segment and jump on once no further digit fits, ↑/↓ step it with wrap-around, ←/→ move between segments (mirrored in RTL), Backspace clears one, a typed separator moves on, a/p set AM/PM and Alt+↓ opens the picker. A pasted date fills every segment; an impossible one (Feb 31) shows the invalid state and reverts on blur.
Invoice date: null
import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
import { OgeDateBox } from '@oge-ui/inputs';
@Component({
selector: 'demo-root',
imports: [OgeDateBox],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<!-- Segment entry: the locale's numeric pattern (dd.mm.yyyy in de-DE),
digits fill the selected segment and auto-advance, ArrowUp/Down step
it, ArrowLeft/Right move, Alt+ArrowDown opens the picker. -->
<oge-date-box
label="Invoice date"
locale="de-DE"
[useMaskBehavior]="true"
[(value)]="invoiceDate"
/>
<oge-date-box
label="Check-in"
type="datetime"
locale="en-US"
[useMaskBehavior]="true"
[(value)]="checkIn"
/>
`,
})
export class Demo {
protected readonly invoiceDate = signal<Date | null>(null);
protected readonly checkIn = signal<Date | null>(new Date(2026, 7, 15, 14, 0));
}Range presets & time ranges
presets lists quick ranges beside the calendar — the built-in ogeDateRangePresets.last7Days(), thisMonth(), lastMonth()… (labels from the messages) or your own { label, range: () => [start, end] }, evaluated on pick so a page left open past midnight stays right. The active preset reads aria-pressed; the adaptive dialog shows them as a chip row. type: 'time' makes a time-range picker: no calendar, two time lists and OK.
Report: — → —
import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
import { OgeDateRangeBox, ogeDateRangePresets } from '@oge-ui/inputs';
import type { OgeCalendarRange, OgeDateRangePreset } from '@oge-ui/inputs';
@Component({
selector: 'demo-root',
imports: [OgeDateRangeBox],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<!-- Presets list beside the calendar (a chip row in the adaptive
dialog). Built-ins take their labels from the messages; a custom
preset is { label, range: () => [start, end] }. -->
<oge-date-range-box label="Report period" [presets]="presets" [(value)]="report" />
<!-- type="time": a time-range picker — no calendar, two lists + OK -->
<oge-date-range-box label="Opening hours" type="time" [interval]="30" [(value)]="hours" />
`,
})
export class Demo {
protected readonly presets: OgeDateRangePreset[] = [
ogeDateRangePresets.today(),
ogeDateRangePresets.last7Days(),
ogeDateRangePresets.last30Days(),
ogeDateRangePresets.thisMonth(),
ogeDateRangePresets.lastMonth(),
ogeDateRangePresets.thisYear(),
{ label: 'Q1 2026', range: () => [new Date(2026, 0, 1), new Date(2026, 2, 31)] },
];
protected readonly report = signal<OgeCalendarRange>([null, null]);
protected readonly hours = signal<OgeCalendarRange>([
new Date(2026, 7, 15, 9, 0),
new Date(2026, 7, 15, 17, 30),
]);
}Time zones
One instant, three clocks. timeZone shows and edits the value on a zone's wall clock while the bound value stays the same Date: change the time in one box and the others follow on their own clocks. timeZone: 'UTC' keeps a date-only value stored as UTC midnight on its day in every browser.
Stored instant: 2026-03-05T14:00:00.000Z
import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
import { OgeDateBox } from '@oge-ui/inputs';
@Component({
selector: 'demo-root',
imports: [OgeDateBox],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<!-- one instant on three clocks: the bound Date never changes zone -->
<oge-date-box label="Istanbul" type="datetime" timeZone="Europe/Istanbul" [(value)]="meeting" />
<oge-date-box label="New York" type="datetime" timeZone="America/New_York" [(value)]="meeting" />
<!-- a date-only value stored as UTC midnight: the same day in every browser -->
<oge-date-box label="Birthday" timeZone="UTC" [(value)]="birthday" />
`,
})
export class Demo {
protected readonly meeting = signal<Date | null>(new Date(Date.UTC(2026, 2, 5, 14)));
protected readonly birthday = signal<Date | null>(new Date(Date.UTC(1990, 4, 17)));
}Grid integration
Grid and tree-list dataType: 'date' cells now edit through <oge-date-box> (compact sm shape) and the filter row applies a timezone-safe local day-range — [startOfDay, nextDay) for equality, day boundaries for ordering operators. Rows keep their storage shape: Date stays Date, yyyy-MM-dd strings round-trip as strings.
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { OgeColumn, OgeGrid } from '@oge-ui/grid';
@Component({
selector: 'demo-root',
imports: [OgeColumn, OgeGrid],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<!-- grid date editors and the filter row now run on <oge-date-box> -->
<oge-grid [data]="rows" keyField="id" [filterRow]="true" [editing]="{ mode: 'cell' }">
<oge-column field="shipped" dataType="date" />
</oge-grid>
<!-- filtering builds a timezone-safe local day-range: [startOfDay, nextDay) -->
`,
})
export class Demo {
protected readonly rows = [
{ id: 1, shipped: new Date(2026, 2, 11) },
{ id: 2, shipped: new Date(2026, 5, 2) },
];
}Keyboard & accessibility
- Calendar:
role="grid"with real DOM focus on the day buttons (roving tabindex — deliberately notaria-activedescendant, per the APG date-picker-dialog pattern);aria-current="date"marks today. - Date box: ↓ opens the picker and hands focus to the calendar; Esc closes it and restores focus to the input, pressed again it reverts uncommitted text; Enter commits the typed text. With
useMaskBehaviorthe arrows edit segments instead, so Alt+↓ opens the picker. - Time columns are labelled listboxes (Hours, Minutes, Seconds, AM/PM — from the messages); range presets are a labelled group of
aria-pressedtoggle buttons. - All texts (month/weekday names, aria labels, error messages) come from
Intl+ the localizedOgeInputsMessages.