# Date &amp; time

**Date pickers** and **time pickers** allow users to select and navigate through past, present, and future dates and times.

## Usage

These components are used in scenarios where users need to input specific dates, times, or date ranges.

Date pickers typically include an expandable calendar menu and a text input field, while time pickers focus solely on time selection, usually a text input field or dropdown menu for selecting specific times.

![Date time](<../images/date-time.png>)

### When to use

- To collect absolute date and time inputs.
- For scheduling tasks.
- In [forms](<https://element.siemens.io/components/forms-inputs/forms/>).
- To select date ranges for generating reports or viewing historical data.
- For relative date selection, use [date range filter](<https://element.siemens.io/components/forms-inputs/date-range-filter/>).

### Best practices

- Ensure the format of dates and times adheres to the user's locale settings. See [localization](<https://element.siemens.io/fundamentals/localization/>) for more details.
- Ensure placeholders are also localized to match the user's regional settings (e.g., "MM/DD/YYYY").
- When required, validation can be set for all time inputs.
- Provide clear and concise labels for input fields.

## Design

### Basic anatomy

Date pickers and date-time pickers consist of an optional input field and a calendar view. The input field allows users to manually type dates and times. When needed, the calendar view opens for visual selection, making this structure **common across all variants.**

![Date picker anatomy](<../images/date-picker-anatomy.png>)

> 1. Label (optional), 2. Input, 3. Calendar button, 4. Month &amp; Year control, 5. Previous and Next month control, 6. Default day, 7. Selected day, 8. Current day, 9. Off month day, 10. Today control

### Single date and date-time picker

The single date picker allows users to select a specific date, either by typing in the input field or using the calendar view. When the time option is enabled, users can also select a specific time.

![Single date picker](<../images/single-date-picker.png>)

### Date and date-time range picker

The date range picker enables users to choose a start and end date. When the time option is enabled, a two-month view layout is used.

![Date range picker](<../images/date-range-picker.png>)

### Time picker

The time picker is a component with separate input fields for individually setting units of time measurement (e.g., hh, mm, …). Minutes, seconds, and milliseconds are optional and can be configured to show or hide as needed.

![Date range picker](<../images/time-picker.png>)

## Code

The datepicker and timepicker components are highly configurable. The datepicker optionally includes the timepicker.

The `SiDatepickerComponent`, `SiTimepickerComponent`, as well as the `SiDatepickerDirective`, to attach the datepicker component to a HTML input element, are provided by the `SiDatepickerModule` Angular module.

### Usage

`Datepicker` can be imported using the module

```
import { SiDatepickerModule } from '@siemens/element-ng/datepicker';

@NgModule({
  imports: [SiDatepickerModule, ...]
})
```

or as a standalone component:

```
import {
  SiDateInputDirective,
  SiDatepickerComponent,
  SiDatepickerDirective,
  SiDateRangeComponent
} from '@siemens/element-ng/datepicker';

@Component({
  imports: [
    SiDateInputDirective,
    SiDatepickerComponent,
    SiDatepickerDirective,
    SiDateRangeComponent,
    ...
  ]
})
```

### Datepicker without time

The datepicker component can be added to any view. Bidirectional binding of the date object is provided by the `date` property. The configuration is handled by the `config` object as documented in the API.

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
import { SiDatepickerComponent } from '@siemens/element-ng/datepicker';

@Component({
  selector: 'app-sample',
  imports: [CommonModule, SiDatepickerComponent],
  templateUrl: './si-datepicker-no-time.html',
  host: { class: 'p-5' }
})
export class SampleComponent {
  myDate = new Date('2022-03-12T05:00:00.000Z');
}
```

Template:

```html
<div class="d-flex align-items-start">
  <si-datepicker class="d-inline-block me-6" [(date)]="myDate" />
  <si-datepicker class="d-inline-block" [(date)]="myDate" />
</div>
<div class="mt-6">Selected date: {{ myDate | date: 'full' }}</div>
```

### Datepicker with time control

- Setting `showTime` in the config will display the timepicker within the date picker.
- A switch enables the user to include (`Consider time`) the time or not (`Ignore time`).
- Initial switch enablement is controlled by the `disabledTime` flag and changes are emitted by the `disabledTimeChange` output property.
- Use the `mandatoryTime` flag to hide the switch.

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
import { SiDatepickerComponent } from '@siemens/element-ng/datepicker';

@Component({
  selector: 'app-sample',
  imports: [CommonModule, SiDatepickerComponent],
  templateUrl: './si-datepicker.html',
  host: { class: 'p-5' }
})
export class SampleComponent {
  myDate = new Date('2022-03-12T05:00:00.000Z');
  minDate = new Date('2014-03-12T05:00:00.000Z');
}
```

Template:

```html
<div class="d-flex align-items-start">
  <si-datepicker
    class="d-inline-block me-6"
    [config]="{
      minDate: minDate,
      showTime: true,
      todayText: 'Today',
      weekStartDay: 'monday',
      hideWeekNumbers: false,
      showMinutes: true,
      showSeconds: true,
      showMilliseconds: false,
      mandatoryTime: false,
      disabledTime: false,
      enabledTimeText: 'Consider time',
      disabledTimeText: 'Ignore time'
    }"
    [(date)]="myDate"
  />
  <si-datepicker
    class="d-inline-block"
    [config]="{ minDate: minDate, showTime: true, disabledTime: false }"
    [(date)]="myDate"
  />
</div>
<div class="mt-6">Selected date: {{ myDate | date: 'full' }}</div>
```

### Datepicker with date range

The `si-datepicker` allows to pick date ranges. Use the two-way binded property `dateRange` and set `enableDateRange: true` in configuration.

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
import { DateRange, SiDatepickerComponent } from '@siemens/element-ng/datepicker';

@Component({
  selector: 'app-sample',
  imports: [CommonModule, SiDatepickerComponent],
  templateUrl: './si-datepicker-range.html',
  host: { class: 'p-5' }
})
export class SampleComponent {
  myDateRange: DateRange = {
    start: new Date('2022-03-01'),
    end: new Date('2022-03-03')
  };
}
```

Template:

```html
<div class="d-flex align-items-start">
  <si-datepicker
    class="d-inline-block me-6"
    [config]="{ enableDateRange: true }"
    [(dateRange)]="myDateRange"
  />
  <si-datepicker
    class="d-inline-block"
    [config]="{ enableDateRange: true }"
    [(dateRange)]="myDateRange"
  />
</div>
<div class="mt-6">Selected date: {{ myDateRange | json }}</div>
```

### Input element with datepicker

The `SiDatepickerDirective` attaches the datepicker to an HTML input element. Without any additional configuration, the Angular locale date formatter is used to write the selected date into the input field. Changes of the input field are also parsed and used to set the date in the datepicker. Optionally, you can provide a custom date and time format using the `config` object.

The directive implements the Angular `ControlValueAccessor` and can be used in Angular Forms.

#### Example

##### Datepicker Input

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SiDatepickerDirective, SiCalendarButtonComponent } from '@siemens/element-ng/datepicker';
import { SiFormItemComponent } from '@siemens/element-ng/form';

@Component({
  selector: 'app-sample',
  imports: [FormsModule, SiDatepickerDirective, SiCalendarButtonComponent, SiFormItemComponent],
  templateUrl: './si-datepicker-input.html'
})
export class SampleComponent {
  date = new Date('2022-03-12');
  validationDate = new Date('2022-03-12');
  minDate = new Date('2022-03-12T05:30:00');
  maxDate = new Date('2022-06-12T18:00:00');
}
```

Template:

```html
<div class="pt-6">
  <div class="row justify-content-center mx-0">
    {{ date }}
  </div>
  <div class="row justify-content-center mx-0">
    <div class="col-12 col-md-4">
      <si-form-item label="Date">
        <si-calendar-button class="w-100">
          <input type="text" class="form-control" siDatepicker [(ngModel)]="date" />
        </si-calendar-button>
      </si-form-item>
    </div>
  </div>
  <div class="row justify-content-center mx-0">
    <div class="col-12 col-md-4">
      <si-form-item label="Date with custom format">
        <si-calendar-button class="w-100">
          <input
            type="text"
            class="form-control"
            siDatepicker
            [siDatepickerConfig]="{ dateFormat: 'dd.MM.yyyy' }"
            [(ngModel)]="date"
          />
        </si-calendar-button>
      </si-form-item>
    </div>
  </div>
  <div class="row justify-content-center mx-0">
    <div class="col-12 col-md-4">
      <si-form-item label="Date and time">
        <si-calendar-button class="w-100">
          <input
            type="text"
            class="form-control"
            siDatepicker
            [siDatepickerConfig]="{
              showTime: true,
              dateFormat: 'dd.MM.yyyy',
              dateTimeFormat: 'dd.MM.yyyy HH:mm'
            }"
            [(ngModel)]="date"
          />
        </si-calendar-button>
      </si-form-item>
    </div>
  </div>
  <div class="row justify-content-center mx-0">
    <div class="col-12 col-md-4">
      <si-form-item label="Date and time with seconds">
        <si-calendar-button class="w-100">
          <input
            type="text"
            class="form-control"
            siDatepicker
            [siDatepickerConfig]="{ showTime: true, showSeconds: true, mandatoryTime: true }"
            [(ngModel)]="date"
          />
        </si-calendar-button>
      </si-form-item>
    </div>
  </div>
  <div class="row justify-content-center mx-0">
    <div class="col-12 col-md-4">
      <si-form-item label="Datepicker without initial value">
        <si-calendar-button class="w-100">
          <input
            type="text"
            placeholder="Datepicker without initial value"
            class="form-control"
            siDatepicker
          />
        </si-calendar-button>
      </si-form-item>
    </div>
  </div>
  <div class="row justify-content-center mx-0">
    <div class="col-12 col-md-4">
      <si-form-item label="Show validation status">
        <si-calendar-button class="w-100">
          <input
            #validation="ngModel"
            type="text"
            placeholder="Datepicker with validation state"
            class="form-control"
            siDatepicker
            [siDatepickerConfig]="{
              showTime: true,
              dateFormat: 'dd.MM.yyyy',
              minDate: minDate,
              maxDate: maxDate,
              enableTimeValidation: true
            }"
            [(ngModel)]="validationDate"
          />
        </si-calendar-button>
      </si-form-item>
      <div class="pt-2">Date is {{ validation.control.status }}</div>
    </div>
  </div>
</div>
```

##### Datepicker Input Playground

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component, inject, LOCALE_ID, OnInit } from '@angular/core';
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
import {
  DatepickerInputConfig,
  getDatepickerFormat,
  SiCalendarButtonComponent,
  SiDatepickerDirective,
  WeekStart
} from '@siemens/element-ng/datepicker';
import { SiFormItemComponent } from '@siemens/element-ng/form';
import { LOG_EVENT } from '@siemens/live-preview';
import { filter, map } from 'rxjs/operators';

@Component({
  selector: 'app-sample',
  imports: [
    FormsModule,
    ReactiveFormsModule,
    SiDatepickerDirective,
    SiCalendarButtonComponent,
    SiFormItemComponent
  ],
  templateUrl: './si-datepicker-input-playground.html'
})
export class SampleComponent implements OnInit {
  readonly logEvent = inject(LOG_EVENT);

  configForm = new FormGroup({
    dateTimeFormat: new FormControl('dd.MM.yyyy HH:mm', { nonNullable: true }),
    dateFormat: new FormControl<string>('dd.MM.yyyy', { nonNullable: true }),
    todayText: new FormControl('Today', { nonNullable: true }),
    weekStartDay: new FormControl<WeekStart>('monday', { nonNullable: true }),
    hideWeekNumbers: new FormControl(false, { nonNullable: true }),
    showTime: new FormControl(false, { nonNullable: true }),
    showMinutes: new FormControl(false, { nonNullable: true }),
    showSeconds: new FormControl(false, { nonNullable: true }),
    showMilliseconds: new FormControl(false, { nonNullable: true }),
    onlyMonthSelection: new FormControl(false, { nonNullable: true }),
    mandatoryTime: new FormControl(false, { nonNullable: true }),
    disabledTime: new FormControl(false, { nonNullable: true }),
    enabledTimeText: new FormControl('Consider time', { nonNullable: true }),
    disabledTimeText: new FormControl('Ignore time', { nonNullable: true }),
    enableTimeValidation: new FormControl(false, { nonNullable: true }),
    minDateString: new FormControl(this.getDateRange().minDate, { nonNullable: true }),
    maxDateString: new FormControl(this.getDateRange().maxDate, { nonNullable: true })
  });

  config: DatepickerInputConfig = {
    dateTimeFormat: this.configForm.controls.dateTimeFormat.value,
    dateFormat: this.configForm.controls.dateFormat.value,
    minDate: new Date(this.configForm.controls.minDateString.value),
    maxDate: new Date(this.configForm.controls.maxDateString.value)
  };
  value = new Date();
  placeholder: string;
  required = true;
  readonly = false;
  disabled = false;
  autoClose = false;

  protected locale = inject(LOCALE_ID);

  constructor() {
    this.placeholder = getDatepickerFormat(this.locale, this.config);
  }

  // Set a range of 3 years in the past and 3 years in the future to current date
  private getDateRange(): { minDate: string; maxDate: string } {
    const dateNow = new Date();
    const minDate = new Date(dateNow);
    const maxDate = new Date(dateNow);

    minDate.setFullYear(dateNow.getFullYear() - 3);
    maxDate.setFullYear(dateNow.getFullYear() + 3);

    return {
      minDate: minDate.toISOString().slice(0, 16),
      maxDate: maxDate.toISOString().slice(0, 16)
    };
  }

  ngOnInit(): void {
    // Update configuration on value change
    this.configForm.valueChanges
      .pipe(
        map(c => {
          const minDate = new Date(c.minDateString!);
          const maxDate = new Date(c.maxDateString!);
          return { ...c, minDate, maxDate };
        }),
        filter(() => this.configForm.valid)
      )
      .subscribe(c => {
        this.config = c;
        this.placeholder = getDatepickerFormat(this.locale, this.config);
      });
  }

  stringify(value: any): string {
    return JSON.stringify(value);
  }
}
```

Template:

```html
<div class="p-5">
  <div class="pt-6">
    <div class="row justify-content-center mx-0">
      <div class="col-12 col-md-4">
        <si-form-item label="Date input (empty with placeholder)">
          <input
            autocomplete="off"
            class="form-control"
            id="si-datetime-input-0"
            type="text"
            siDatepicker
            [placeholder]="placeholder"
            [required]="required"
            [readonly]="readonly"
            [disabled]="disabled"
            [autoClose]="autoClose"
            [siDatepickerConfig]="config"
            (siDatepickerClose)="logEvent('siDatepickerClosed', $event)"
            (siDatepickerDisabledTime)="logEvent('siDatepickerDisabledTime', $event)"
          />
          <small class="form-text">Placeholder text not displayed for disabled input</small>
        </si-form-item>
      </div>
    </div>
    <div class="row justify-content-center mx-0">
      <div class="col-12 col-md-4">
        <si-form-item label="Date input">
          <input
            #control="ngModel"
            #validation="ngModel"
            autocomplete="off"
            class="form-control"
            id="si-datetime-input-1"
            type="text"
            siDatepicker
            [placeholder]="placeholder"
            [required]="required"
            [readonly]="readonly"
            [disabled]="disabled"
            [autoClose]="autoClose"
            [siDatepickerConfig]="config"
            [(ngModel)]="value"
            (siDatepickerClose)="logEvent('siDatepickerClosed', $event)"
            (siDatepickerDisabledTime)="logEvent('siDatepickerDisabledTime', $event)"
          />
        </si-form-item>
      </div>
    </div>
    <div class="row justify-content-center mx-0">
      <div class="col-12 col-md-4">
        <label
          for="si-datetime-input-2"
          class="form-label"
          [class.required]="required && !readonly"
        >
          Date input with calendar button
        </label>
        <si-calendar-button class="w-100">
          <input
            #control="ngModel"
            #validation="ngModel"
            autocomplete="off"
            class="form-control"
            id="si-datetime-input-2"
            type="text"
            siDatepicker
            [placeholder]="placeholder"
            [required]="required"
            [readonly]="readonly"
            [disabled]="disabled"
            [autoClose]="autoClose"
            [siDatepickerConfig]="config"
            [(ngModel)]="value"
            (siDatepickerClose)="logEvent('siDatepickerClosed', $event)"
            (siDatepickerDisabledTime)="logEvent('siDatepickerDisabledTime', $event)"
          />
        </si-calendar-button>
      </div>
    </div>
  </div>
  <div class="card mt-6 e2e-ignore">
    <div class="card-header">Control panel</div>
    <div class="card-body">
      <div class="mb-6"> Validation: {{ stringify(control.errors) }} </div>
      <div class="row">
        <div class="col-sm-3">
          <si-form-item label="Readonly">
            <input type="checkbox" class="form-check-input" [(ngModel)]="readonly" />
          </si-form-item>
        </div>
        <div class="col-sm-3">
          <si-form-item label="Required">
            <input type="checkbox" class="form-check-input" [(ngModel)]="required" />
          </si-form-item>
        </div>
        <div class="col-sm-3">
          <si-form-item label="Disabled">
            <input type="checkbox" class="form-check-input" [(ngModel)]="disabled" />
          </si-form-item>
        </div>
        <div class="col-sm-3">
          <si-form-item label="Auto close on selection">
            <input type="checkbox" class="form-check-input" [(ngModel)]="autoClose" />
          </si-form-item>
        </div>
      </div>
      <form [formGroup]="configForm">
        <div class="row">
          <div class="col-sm-3">
            <si-form-item label="Show Time">
              <input type="checkbox" class="form-check-input" formControlName="showTime" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Disabled time">
              <input type="checkbox" class="form-check-input" formControlName="disabledTime" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Show minutes">
              <input type="checkbox" class="form-check-input" formControlName="showMinutes" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Show seconds">
              <input type="checkbox" class="form-check-input" formControlName="showSeconds" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Show milliseconds">
              <input type="checkbox" class="form-check-input" formControlName="showMilliseconds" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Only month selection">
              <input
                type="checkbox"
                class="form-check-input"
                formControlName="onlyMonthSelection"
              />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Hide week numbers">
              <input type="checkbox" class="form-check-input" formControlName="hideWeekNumbers" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Mandatory time">
              <input type="checkbox" class="form-check-input" formControlName="mandatoryTime" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Enable time validation">
              <input
                type="checkbox"
                class="form-check-input"
                formControlName="enableTimeValidation"
              />
            </si-form-item>
          </div>
        </div>
        <div class="row">
          <div class="col-sm-3">
            <si-form-item label="Min date">
              <input type="datetime-local" class="form-control" formControlName="minDateString" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Max date">
              <input type="datetime-local" class="form-control" formControlName="maxDateString" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Date format">
              <input type="text" class="form-control" formControlName="dateFormat" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Date time format">
              <input type="text" class="form-control" formControlName="dateTimeFormat" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Week start day">
              <select class="form-control" formControlName="weekStartDay">
                <option value="monday">Monday</option>
                <option value="sunday">Sunday</option>
                <option value="saturday">Saturday</option>
              </select>
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Today text">
              <input type="text" class="form-control" formControlName="todayText" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Enabled time text">
              <input type="text" class="form-control" formControlName="enabledTimeText" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Disabled time text">
              <input type="text" class="form-control" formControlName="disabledTimeText" />
            </si-form-item>
          </div>
        </div>
      </form>
    </div>
  </div>
  <div class="mt-6">Selected date: {{ value }}</div>
</div>
```

### Input element with date range picker

The `SiDateRangeComponent` component is a custom component which can be used to use datepicker as range selector.

The component implements the Angular `ControlValueAccessor` and can be used in Angular Forms.

#### Example

##### Date Range

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
import { DateRange, SiDateRangeComponent } from '@siemens/element-ng/datepicker';
import { SiFormItemComponent } from '@siemens/element-ng/form';

@Component({
  selector: 'app-sample',
  imports: [CommonModule, ReactiveFormsModule, SiDateRangeComponent, SiFormItemComponent],
  templateUrl: './si-date-range.html',
  host: { class: 'p-5' }
})
export class SampleComponent {
  dateRange = new FormControl<DateRange | null>(null);
}
```

Template:

```html
<div class="row justify-content-center pt-6">
  <div class="col-2 col-md-2">
    <si-form-item label="Date range">
      <si-date-range [formControl]="dateRange" />
    </si-form-item>
  </div>
  <div class="col-12">
    <h4>Date range value</h4>
    @if (dateRange.value?.start || dateRange.value?.end) {
      <pre>{{ dateRange.value | json }}</pre>
    }
    <h4>Validation:</h4>
    @if (dateRange.valid) {
      <div>Date range is VALID</div>
    }
    @if (dateRange.errors?.invalidStartDateFormat) {
      <div>Start date is INVALID</div>
    }
    @if (dateRange.errors?.invalidEndDateFormat) {
      <div>End date is INVALID</div>
    }
  </div>
</div>
```

##### Date Range Playground

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { JsonPipe, KeyValuePipe } from '@angular/common';
import { Component, inject, OnInit } from '@angular/core';
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
import {
  DatepickerInputConfig,
  DateRange,
  SiDateRangeComponent,
  WeekStart
} from '@siemens/element-ng/datepicker';
import { SiFormItemComponent } from '@siemens/element-ng/form';
import { LOG_EVENT } from '@siemens/live-preview';
import { filter, map } from 'rxjs/operators';

@Component({
  selector: 'app-sample',
  imports: [
    FormsModule,
    JsonPipe,
    KeyValuePipe,
    ReactiveFormsModule,
    SiDateRangeComponent,
    SiFormItemComponent
  ],
  templateUrl: './si-date-range-playground.html'
})
export class SampleComponent implements OnInit {
  readonly logEvent = inject(LOG_EVENT);

  readonly dateRange = new FormControl<DateRange | null>({
    start: new Date('2023-03-15T07:23:00.000Z'),
    end: new Date('2023-12-15T06:33:00.000Z')
  });

  readonly configForm = new FormGroup({
    dateFormat: new FormControl<string>('dd.MM.yyyy', { nonNullable: true }),
    todayText: new FormControl('Today', { nonNullable: true }),
    weekStartDay: new FormControl<WeekStart>('monday', { nonNullable: true }),
    hideWeekNumbers: new FormControl(false, { nonNullable: true }),
    enableTwoMonthDateRange: new FormControl(true, { nonNullable: true }),
    showTime: new FormControl(true, { nonNullable: true }),
    showSeconds: new FormControl(false, { nonNullable: true }),
    showMilliseconds: new FormControl(false, { nonNullable: true }),
    onlyMonthSelection: new FormControl(false, { nonNullable: true }),
    disabledTime: new FormControl(false, { nonNullable: true }),
    mandatoryTime: new FormControl(false, { nonNullable: true }),
    minDateString: new FormControl('2018-06-15', { nonNullable: true }),
    maxDateString: new FormControl('2025-07-15', { nonNullable: true })
  });

  disabledTime = false;
  config: DatepickerInputConfig = {
    dateFormat: this.configForm.controls.dateFormat.value,
    minDate: new Date(this.configForm.controls.minDateString.value),
    maxDate: new Date(this.configForm.controls.maxDateString.value),
    enableTwoMonthDateRange: true,
    showTime: true,
    showSeconds: false,
    showMilliseconds: false,
    disabledTime: this.disabledTime,
    mandatoryTime: false
  };

  startPlaceholder!: string;
  endPlaceholder!: string;
  required = true;
  readonly = false;
  autoClose = false;

  ngOnInit(): void {
    const format = this.configForm.controls.dateFormat.value;
    this.startPlaceholder = `Start ${format}`;
    this.endPlaceholder = `End ${format}`;
    // Update configuration on value change
    this.configForm.valueChanges
      .pipe(
        map(c => {
          const minDate = new Date(c.minDateString!);
          const maxDate = new Date(c.maxDateString!);
          return { ...c, minDate, maxDate };
        }),
        filter(() => this.configForm.valid)
      )
      .subscribe(c => {
        this.config = c;
        if (this.config.dateFormat) {
          this.startPlaceholder = `Start ${this.config.dateFormat}`;
          this.endPlaceholder = `End ${this.config.dateFormat}`;
        }
      });
  }

  stringify(value: any): string {
    return JSON.stringify(value);
  }

  disableChange(disable: boolean): void {
    if (disable) {
      this.dateRange.disable();
    } else {
      this.dateRange.enable();
    }
  }
}
```

Template:

```html
<div class="p-5">
  <div class="row justify-content-center">
    <div class="col-12">
      <si-form-item label="Date Range Input">
        <si-date-range
          [formControl]="dateRange"
          [siDatepickerConfig]="config"
          [startDatePlaceholder]="startPlaceholder"
          [endDatePlaceholder]="endPlaceholder"
          [required]="required && !readonly"
          [readonly]="readonly"
          [autoClose]="autoClose"
          (siDatepickerRangeChange)="logEvent('siDatepickerRangeChange', $event)"
          (disabledTimeChange)="disabledTime = $event"
        />
      </si-form-item>
    </div>
  </div>

  <div class="card e2e-ignore">
    <div class="card-header">Control panel</div>
    <div class="card-body">
      <div class="row">
        <div class="col-sm-3">
          <si-form-item label="Readonly">
            <input type="checkbox" class="form-check-input" [(ngModel)]="readonly" />
          </si-form-item>
        </div>
        <div class="col-sm-3">
          <si-form-item label="Required">
            <input type="checkbox" class="form-check-input" [(ngModel)]="required" />
          </si-form-item>
        </div>
        <div class="col-sm-3">
          <si-form-item label="Disabled">
            <input
              type="checkbox"
              class="form-check-input"
              [ngModel]="false"
              (ngModelChange)="disableChange($event)"
            />
          </si-form-item>
        </div>
        <div class="col-sm-3">
          <si-form-item label="Auto close on selection">
            <input type="checkbox" class="form-check-input" [(ngModel)]="autoClose" />
          </si-form-item>
        </div>
      </div>
      <form [formGroup]="configForm">
        <div class="row">
          <div class="col-sm-3">
            <si-form-item label="Hide week numbers">
              <input type="checkbox" class="form-check-input" formControlName="hideWeekNumbers" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Two months">
              <input
                type="checkbox"
                class="form-check-input"
                formControlName="enableTwoMonthDateRange"
              />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Only month selection">
              <input
                type="checkbox"
                class="form-check-input"
                formControlName="onlyMonthSelection"
              />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Show time">
              <input type="checkbox" class="form-check-input" formControlName="showTime" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Show seconds">
              <input type="checkbox" class="form-check-input" formControlName="showSeconds" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Show milliseconds">
              <input type="checkbox" class="form-check-input" formControlName="showMilliseconds" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Disable time">
              <input type="checkbox" class="form-check-input" formControlName="disabledTime" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Mandatory time">
              <input type="checkbox" class="form-check-input" formControlName="mandatoryTime" />
            </si-form-item>
          </div>
        </div>
        <div class="row">
          <div class="col-sm-3">
            <si-form-item label="Min date">
              <input type="date" class="form-control" formControlName="minDateString" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Max date">
              <input type="date" class="form-control" formControlName="maxDateString" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Date format">
              <input type="text" class="form-control" formControlName="dateFormat" />
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Week start day">
              <select class="form-control" formControlName="weekStartDay">
                <option value="monday">Monday</option>
                <option value="sunday">Sunday</option>
                <option value="saturday">Saturday</option>
              </select>
            </si-form-item>
          </div>
          <div class="col-sm-3">
            <si-form-item label="Today text">
              <input type="text" class="form-control" formControlName="todayText" />
            </si-form-item>
          </div>
        </div>
      </form>
    </div>
  </div>

  <div class="mt-6">
    <h4>Date range value</h4>
    <span class="d-inline">
      From <b>{{ dateRange.value?.start?.toDateString() }}</b>
      {{ !disabledTime ? dateRange.value?.start?.toTimeString() : '' }}
    </span>
    <span class="d-inline">
      to <b>{{ dateRange.value?.end?.toDateString() }}</b>
      {{ !disabledTime ? dateRange.value?.end?.toTimeString() : '' }}
    </span>
    @if (dateRange.value?.start || dateRange.value?.end) {
      <pre class="mt-2">{{ stringify(dateRange.value) }}</pre>
    }

    <h4 class="mt-6">Validation:</h4>
    @switch (dateRange.valid) {
      @case (true) {
        <div>Date range is VALID</div>
      }
      @default {
        <div>
          @for (error of dateRange.errors | keyvalue; track $index) {
            <div> {{ error.key }}: {{ error.value | json }} </div>
          }
        </div>
      }
    }
  </div>
</div>
```

### Timepicker

The timepicker component is a custom component with individual input fields for setting the parts of the time individually, like hours, and minutes. It implements the `ControlValueAccessor` and can be used in Angular Forms.

#### Example

##### Timepicker

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { CommonModule } from '@angular/common';
import { Component, signal, WritableSignal } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SiTimepickerComponent } from '@siemens/element-ng/datepicker';
import { SiFormItemComponent } from '@siemens/element-ng/form';

@Component({
  selector: 'app-sample',
  imports: [CommonModule, SiTimepickerComponent, FormsModule, SiFormItemComponent],
  templateUrl: './si-timepicker.html'
})
export class SampleComponent {
  readonly min = signal<Date | undefined>(new Date('2022-01-10T06:00:00.000Z'));
  readonly max = signal<Date | undefined>(new Date('2022-01-10T09:00:00.000Z'));

  mytime = new Date('2022-01-12T05:00:00.000Z');
  showSeconds = true;
  showMilliseconds = true;
  showMeridian = true;
  hideLabels = false;
  readonly = false;
  disabled = false;

  update(input: WritableSignal<Date | undefined>, time: string): void {
    if (time) {
      const parts = time.split(':').map(v => parseInt(v, 10));
      input.set(new Date(2022, 0, 10, parts.at(0)!, parts.at(1)!, parts.at(2) ?? 0));
    } else {
      input.set(undefined);
    }
  }

  toTime(time: Date | undefined, previous: string): string {
    if (!time) {
      return previous;
    }
    const v = `${time.getHours().toString().padStart(2, '0')}:${time.getMinutes().toString().padStart(2, '0')}:${time.getSeconds().toString().padStart(2, '0')}`;
    return v;
  }

  stringify(value: any): string {
    return JSON.stringify(value);
  }
}
```

Template:

```html
<div class="p-5">
  <div class="row justify-content-center pt-6">
    <div class="col-12 col-md-4">
      <si-form-item label="Timepicker on date object">
        <si-timepicker
          #control="ngModel"
          [hideLabels]="hideLabels"
          [max]="max()"
          [min]="min()"
          [showMinutes]="true"
          [showSeconds]="showSeconds"
          [showMilliseconds]="showMilliseconds"
          [showMeridian]="showMeridian"
          [readonly]="readonly"
          [disabled]="disabled"
          [(ngModel)]="mytime"
        />
      </si-form-item>
    </div>
  </div>
  <div class="card mt-6 e2e-ignore">
    <div class="card-header">Control panel</div>
    <div class="card-body">
      <div class="mb-6"><strong>Validation:</strong> {{ stringify(control.errors) }}</div>
      <div class="row">
        <div class="col-sm-3">
          <si-form-item label="Show seconds">
            <input type="checkbox" class="form-check-input" [(ngModel)]="showSeconds" />
          </si-form-item>
        </div>
        <div class="col-sm-3">
          <si-form-item label="Show milliseconds">
            <input type="checkbox" class="form-check-input" [(ngModel)]="showMilliseconds" />
          </si-form-item>
        </div>
        <div class="col-sm-3">
          <si-form-item label="Show meridian">
            <input type="checkbox" class="form-check-input" [(ngModel)]="showMeridian" />
          </si-form-item>
        </div>
        <div class="col-sm-3">
          <si-form-item label="Hide labels">
            <input class="form-check-input" type="checkbox" [(ngModel)]="hideLabels" />
          </si-form-item>
        </div>
      </div>
      <div class="row">
        <div class="col-sm-3">
          <si-form-item label="Readonly">
            <input class="form-check-input" id="readonly" type="checkbox" [(ngModel)]="readonly" />
          </si-form-item>
        </div>
        <div class="col-sm-3">
          <si-form-item label="Disabled">
            <input class="form-check-input" type="checkbox" [(ngModel)]="disabled" />
          </si-form-item>
        </div>
      </div>
      <div class="row">
        <div class="col-sm-3">
          <si-form-item label="Min time">
            <input
              #inputMin
              class="form-control"
              type="time"
              name="min-time"
              step="1"
              [ngModel]="toTime(min(), inputMin.value)"
              (ngModelChange)="update(min, $event)"
            />
          </si-form-item>
        </div>
        <div class="col-sm-3">
          <si-form-item label="Max time">
            <input
              #inputMax
              class="form-control"
              type="time"
              name="max-time"
              step="1"
              [ngModel]="toTime(max(), inputMax.value)"
              (ngModelChange)="update(max, $event)"
            />
          </si-form-item>
        </div>
      </div>
    </div>
  </div>
  <div class="row mt-6">
    <span class="col-sm-2 text-secondary">Date</span>
    <span class="col-sm-10" id="fullDate">{{ mytime | date: 'fullDate' }}</span>
  </div>
  <div class="row mt-6">
    <span class="col-sm-2 text-secondary">Time</span>
    <span class="col-sm-10" id="fullTime">{{ mytime | date: 'fullTime' }}</span>
  </div>
  <div class="row mt-6">
    <label for="dateTime" class="col-sm-2 text-secondary">Date & Time</label>
    <div class="col-sm-10" id="dateTime">{{
      mytime | date: 'EEEE, MMMM d, y, h:mm:ss:SSS a zzzz'
    }}</div>
  </div>
</div>
```

### [SiDatepickerComponent](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L76-L671>)

**Kind:** component

**Selector:** `si-datepicker`

```
import { SiDatepickerComponent } from '@siemens/element-ng/datepicker';
```

```
component SiDatepickerComponent implements OnInit, OnChanges, AfterViewInit
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [calendarWeekLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L148-L150>) | `TranslatableString` | `` $localize`:@@SI_DATEPICKER.CALENDAR_WEEK_LABEL:Calendar week` `` | Aria label for week number column |
| [config](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L119-L119>) | `DatepickerConfig` | `{}` | Object to configure the datepicker. |
| [date](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L87-L87>) | `Date \| undefined` |  | The selected date of the datepicker. Use for initialization and for bidirectional binding. |
| [dateRange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L92-L92>) | `DateRange \| undefined` |  | The selected date range of the datepicker. Use for initialization and for bidirectional binding. |
| [disabledTime](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L110-L110>) | `boolean` | `false` | Disabled the optional visible time picker. |
| [focusedDate](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L82-L82>) | `Date \| undefined` |  | The date which is currently focused Compare to the selected date or range the calendar requires to have one element to focus. |
| [hideTimeToggle](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L187-L187>) | `boolean` | `false` | Option to hide the time switch. |
| [initialFocus](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L104-L104>) | `boolean` | `false` | Set initial focus to calendar body. |
| [nextLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L139-L139>) | `TranslatableString` | `` $localize`:@@SI_DATEPICKER.NEXT:Next` `` | Aria label for the next button. Needed for a11y. |
| [previousLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L128-L130>) | `TranslatableString` | `` $localize`:@@SI_DATEPICKER.PREVIOUS:Previous` `` | Aria label for the previous button. Needed for a11y. |
| [rangeType](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L164-L164>) | `RangeType` | `'START'` | Use this to force date range operation to select either start date or end date. |
| [time12h](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L156-L158>) | `boolean` | `undefined` | Enable/disable 12H mode in timepicker. Defaults to locale |
| [timepickerLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L197-L197>) | `string \| undefined` |  | Optional timepicker label. |

#### Output Properties

| Name | Type | Description |
| --- | --- | --- |
| [configChange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L119-L119>) | `DatepickerConfig` | Object to configure the datepicker. |
| [dateChange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L87-L87>) | `Date \| undefined` | The selected date of the datepicker. Use for initialization and for bidirectional binding. |
| [dateRangeChange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L92-L92>) | `DateRange \| undefined` | The selected date range of the datepicker. Use for initialization and for bidirectional binding. |
| [disabledTimeChange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L110-L110>) | `boolean` | Disabled the optional visible time picker. |
| [focusedDateChange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L82-L82>) | `Date \| undefined` | The date which is currently focused Compare to the selected date or range the calendar requires to have one element to focus. |
| [rangeTypeChange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L164-L164>) | `RangeType` | Use this to force date range operation to select either start date or end date. |

#### Attributes and Methods

##### focusActiveCell

[Source for focusActiveCell](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L664-L666>)

Focus the active cell in view. The function is required to transfer the focus from input to the active date cell.

```
focusActiveCell(): void
```

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

### [SiDateRangeComponent](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L96-L438>)

**Kind:** component

**Selector:** `si-date-range`

```
import { SiDateRangeComponent } from '@siemens/element-ng/datepicker';
```

```
component SiDateRangeComponent implements ControlValueAccessor, Validator, AfterViewInit, OnChanges, SiFormItemControl
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [ariaLabelCalendarButton](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L156-L158>) | `TranslatableString` | `` $localize`:@@SI_DATEPICKER.CALENDAR_TOGGLE_BUTTON:Open calendar` `` | Aria label of the date-range calendar toggle button. |
| [autoClose](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L186-L186>) | `boolean` | `false` | Automatically close overlay on date selection. |
| [disabled](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L201-L201>) | `boolean` | `false` | Whether the date range input is disabled. |
| [endDatePlaceholder](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L145-L147>) | `TranslatableString` | `` $localize`:@@SI_DATEPICKER.END_DATE_PLACEHOLDER:End date` `` | Placeholder of the end date input. |
| [endTimeLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L178-L180>) | `TranslatableString` | `` $localize`:@@SI_DATEPICKER.END_TIME_LABEL:To` `` | Form label of the start timepicker. |
| [errormessageId](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L226-L226>) | `string` | `` `${this.id()}-errormessage` `` | This ID will be bound to the `aria-describedby` attribute of the date-range. Use this to reference the element containing the error message(s) for the date-range. It will be picked by the [SiFormItemComponent](<../../../api/siemens/element-ng/components/SiFormItemComponent/index.html#SiFormItemComponent>) if the date-range is used inside a form item.<br><br>Implements [SiFormItemControl](<index.html#t:SiFormItemControl>) |
| [id](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L110-L110>) | `string` | `` `__si-date-range-${SiDateRangeComponent.idCounter++}` `` | The actual id of the control that should be used in the `for` attribute of a label.<br><br>Implements [SiFormItemControl](<index.html#t:SiFormItemControl>) |
| [readonly](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L208-L208>) | `boolean` | `false` | Whether the date range input is readonly. |
| [scrollStrategy](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker-overlay.directive.ts#L83-L86>) | `ScrollStrategy` | `defaultConnectedOverlayScrollStrategy()` | Optional CDK scroll strategy used for the datepicker overlay. |
| [siDatepickerConfig](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L125-L125>) | `DatepickerInputConfig` | `{ enableDateRange: true }` | Date range component configuration. |
| [startDatePlaceholder](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L134-L136>) | `TranslatableString` | `` $localize`:@@SI_DATEPICKER.START_DATE_PLACEHOLDER:Start date` `` | Placeholder of the start date input. |
| [startTimeLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L167-L169>) | `TranslatableString` | `` $localize`:@@SI_DATEPICKER.START_TIME_LABEL:From` `` | Form label of the start timepicker. |
| [value](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L214-L214>) | `DateRange \| undefined` |  | Set the date-range object displayed in the control. The input can be used if the control is used outside Angular forms. |

#### Output Properties

| Name | Type | Description |
| --- | --- | --- |
| [disabledTimeChange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L193-L193>) | `boolean` | Emits an event to notify about disabling the time from the range picker. When time is disable, we construct a pure date objects in UTC 00:00:00 time. |
| [siDatepickerClose](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker-overlay.directive.ts#L90-L90>) | `CloseCause` | Output event on closing datepicker e.g. by clicking backdrop or escape key. |
| [siDatepickerConfigChange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L125-L125>) | `DatepickerInputConfig` | Date range component configuration. |
| [siDatepickerRangeChange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L188-L188>) | `DateRange \| undefined` | Emits on the date range value changes. |
| [valueChange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L214-L214>) | `DateRange \| undefined` | Set the date-range object displayed in the control. The input can be used if the control is used outside Angular forms. |

#### Attributes and Methods

##### labelledby

[Source for labelledby](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-range.component.ts#L112-L115>)

**Modifiers:** readonly

**Type:** `string`

**Default:** `...`

ID that should be assigned to the label element inside the [SiFormItemComponent](<../../../api/siemens/element-ng/components/SiFormItemComponent/index.html#SiFormItemComponent>).

If the target control is not of type input, select or button, it cannot be referenced by a label. Instead, aria-labelledby must be used to create a reference to a label. In such a case, an implementation of [SiFormItemControl](<index.html#t:SiFormItemControl>) must provide the id of the label in [labelledby](<index.html#SiDateRangeComponent.labelledby>). [SiFormItemComponent](<../../../api/siemens/element-ng/components/SiFormItemComponent/index.html#SiFormItemComponent>) will apply the id to the label so that it can be used inside the control to reference it in the aria-labelledby attribute.

Implements [SiFormItemControl](<index.html#t:SiFormItemControl>)

### [SiTimepickerComponent](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L96-L764>)

**Kind:** component

**Selector:** `si-timepicker`

```
import { SiTimepickerComponent } from '@siemens/element-ng/datepicker';
```

```
component SiTimepickerComponent implements ControlValueAccessor, Validator, SiFormItemControl
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [disabled](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L119-L119>) | `boolean` | `false` | All input fields will be disabled if set to true. |
| [errormessageId](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L282-L282>) | `string` | `` `${this.id()}-errormessage` `` | This ID will be bound to the `aria-describedby` attribute of the timepicker. Use this to reference the element containing the error message(s) for the timepicker. It will be picked by the [SiFormItemComponent](<../../../api/siemens/element-ng/components/SiFormItemComponent/index.html#SiFormItemComponent>) if the timepicker is used inside a form item.<br><br>Implements [SiFormItemControl](<index.html#t:SiFormItemControl>) |
| [hideLabels](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L149-L149>) | `boolean` | `false` | Hide the labels of the input fields. |
| [hoursAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L157-L157>) | `TranslatableString` | `` $localize`:@@SI_DATEPICKER.HOURS:Hours` `` |  |
| [hoursLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L126-L126>) | `TranslatableString` | `'hh'` | Visible label for the hours input. |
| [hoursPlaceholder](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L187-L187>) | `string` | `'hh'` | Placeholder for the hours input. |
| [id](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L107-L107>) | `string` | `` `__si-timepicker-${SiTimepickerComponent.idCounter++}` `` | The actual id of the control that should be used in the `for` attribute of a label.<br><br>Implements [SiFormItemControl](<index.html#t:SiFormItemControl>) |
| [max](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L254-L254>) | `Date \| undefined` |  | A maximum time limit. The date part of the date object will be ignored. |
| [meridians](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L208-L208>) | `string[] \| undefined` |  | Custom labels for the AM and PM options. |
| [meridiansAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L221-L221>) | `TranslatableString` | `` $localize`:@@SI_DATEPICKER.PERIOD:Period` `` |  |
| [meridiansLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L214-L214>) | `TranslatableString` | `'am/pm'` | Visible label for the AM/PM selector. |
| [millisecondsAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L178-L180>) | `TranslatableString` | `` $localize`:@@SI_DATEPICKER.MILLISECONDS:Milliseconds` `` |  |
| [millisecondsLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L144-L144>) | `TranslatableString` | `'ms'` | Visible label for the milliseconds input. |
| [millisecondsPlaceholder](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L205-L205>) | `string` | `'ms'` | Placeholder for the milliseconds input. |
| [min](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L249-L249>) | `Date \| undefined` |  | A minimum time limit. The date part of the date object will be ignored. |
| [minutesAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L164-L164>) | `TranslatableString` | `` $localize`:@@SI_DATEPICKER.MINUTES:Minutes` `` |  |
| [minutesLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L132-L132>) | `TranslatableString` | `'mm'` | Visible label for the minutes input. |
| [minutesPlaceholder](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L193-L193>) | `string` | `'mm'` | Placeholder for the minutes input. |
| [readonly](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L261-L261>) | `boolean` | `false` | Whether the time inputs are read-only. |
| [secondsAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L171-L171>) | `TranslatableString` | `` $localize`:@@SI_DATEPICKER.SECONDS:Seconds` `` |  |
| [secondsLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L138-L138>) | `TranslatableString` | `'ss'` | Visible label for the seconds input. |
| [secondsPlaceholder](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L199-L199>) | `string` | `'ss'` | Placeholder for the seconds input. |
| [showMeridian](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L244-L244>) | `boolean \| undefined` |  | Show time in 12-hour period including the select to toggle between AM/PM. |
| [showMilliseconds](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L240-L240>) | `boolean` | `false` | Whether the milliseconds input is displayed. |
| [showMinutes](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L228-L228>) | `boolean` | `true` | Whether the minutes input is displayed. |
| [showSeconds](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L234-L234>) | `boolean` | `false` | Whether the seconds input is displayed. |

#### Output Properties

| Name | Type | Description |
| --- | --- | --- |
| [inputCompleted](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L268-L268>) | `void` | Emits when the user presses Enter in the final time input. |
| [isValid](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L264-L264>) | `boolean` | Emits whether the entered time components form a valid time. |
| [meridianChange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L266-L266>) | `string` | Emits the selected meridian when it changes. |

#### Attributes and Methods

##### labelledby

[Source for labelledby](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-timepicker.component.ts#L109-L112>)

**Modifiers:** readonly

**Type:** `string`

**Default:** `...`

ID that should be assigned to the label element inside the [SiFormItemComponent](<../../../api/siemens/element-ng/components/SiFormItemComponent/index.html#SiFormItemComponent>).

If the target control is not of type input, select or button, it cannot be referenced by a label. Instead, aria-labelledby must be used to create a reference to a label. In such a case, an implementation of [SiFormItemControl](<index.html#t:SiFormItemControl>) must provide the id of the label in [labelledby](<index.html#SiTimepickerComponent.labelledby>). [SiFormItemComponent](<../../../api/siemens/element-ng/components/SiFormItemComponent/index.html#SiFormItemComponent>) will apply the id to the label so that it can be used inside the control to reference it in the aria-labelledby attribute.

Implements [SiFormItemControl](<index.html#t:SiFormItemControl>)

### [SiDatepickerDirective](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.directive.ts#L51-L161>)

**Kind:** directive

**Selector:** `[siDatepicker]`

**Exported as:** `siDatepicker`

```
import { SiDatepickerDirective } from '@siemens/element-ng/datepicker';
```

```
directive SiDatepickerDirective extends SiDateInputDirective implements AfterViewInit
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [autoClose](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.directive.ts#L59-L59>) | `boolean` | `false` | Automatically close overlay on date selection. Do not use this behavior with config showTime = true, because it will close the overlay when the user change one of the time units. |
| [disabled](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L103-L103>) (inherited) | `boolean` | `false` | Whether the date range input is disabled.<br><br>Inherited from [SiDateInputDirective](<../../../api/siemens/element-ng/directives/SiDateInputDirective/index.html#SiDateInputDirective>) |
| [errormessageId](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L121-L121>) (inherited) | `string` | `` `${this.id()}-errormessage` `` | This ID will be bound to the `aria-describedby` attribute of the date-input. Use this to reference the element containing the error message(s) for the date-input. It will be picked by the [SiFormItemComponent](<../../../api/siemens/element-ng/components/SiFormItemComponent/index.html#SiFormItemComponent>) if the date-input is used inside a form item.<br><br>Inherited from [SiDateInputDirective](<../../../api/siemens/element-ng/directives/SiDateInputDirective/index.html#SiDateInputDirective>)<br><br>Implements [SiFormItemControl](<index.html#t:SiFormItemControl>) |
| [id](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L77-L77>) (inherited) | `string` | `` `si-date-input-${SiDateInputDirective.idCounter++}` `` | The actual id of the control that should be used in the `for` attribute of a label.<br><br>Inherited from [SiDateInputDirective](<../../../api/siemens/element-ng/directives/SiDateInputDirective/index.html#SiDateInputDirective>)<br><br>Implements [SiFormItemControl](<index.html#t:SiFormItemControl>) |
| [readonly](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L109-L109>) (inherited) | `boolean` | `false` | Whether the date range input is readonly.<br><br>Inherited from [SiDateInputDirective](<../../../api/siemens/element-ng/directives/SiDateInputDirective/index.html#SiDateInputDirective>) |
| [siDatepickerConfig](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L87-L87>) (inherited) | `DatepickerInputConfig \| undefined` | `{}` | Configuration object for the datepicker.<br><br>Inherited from [SiDateInputDirective](<../../../api/siemens/element-ng/directives/SiDateInputDirective/index.html#SiDateInputDirective>) |
| [siDatepickerScrollStrategy](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker-overlay.directive.ts#L83-L86>) | `ScrollStrategy` | `defaultConnectedOverlayScrollStrategy()` | Optional CDK scroll strategy used for the datepicker overlay. |

#### Output Properties

| Name | Type | Description |
| --- | --- | --- |
| [dateChange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L139-L139>) (inherited, protected) | `Date \| undefined` | Emits a new `date` value on input field value changes.<br><br>Inherited from [SiDateInputDirective](<../../../api/siemens/element-ng/directives/SiDateInputDirective/index.html#SiDateInputDirective>) |
| [siDatepickerClose](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker-overlay.directive.ts#L90-L90>) | `CloseCause` | Output event on closing datepicker e.g. by clicking backdrop or escape key. |
| [siDatepickerConfigChange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L87-L87>) (inherited) | `DatepickerInputConfig \| undefined` | Configuration object for the datepicker.<br><br>Inherited from [SiDateInputDirective](<../../../api/siemens/element-ng/directives/SiDateInputDirective/index.html#SiDateInputDirective>) |
| [siDatepickerDisabledTime](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L93-L93>) (inherited) | `boolean` | Emits an event to notify about disabling the time from the datepicker. When time is disable, we construct a pure date object in UTC 00:00:00 time.<br><br>Inherited from [SiDateInputDirective](<../../../api/siemens/element-ng/directives/SiDateInputDirective/index.html#SiDateInputDirective>) |
| [stateChange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L97-L97>) (inherited) | `void` | Emits an event on state changes e.g. readonly, disable, ... .<br><br>Inherited from [SiDateInputDirective](<../../../api/siemens/element-ng/directives/SiDateInputDirective/index.html#SiDateInputDirective>) |

#### Attributes and Methods

##### registerOnChange

[Source for registerOnChange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L174-L176>)

**Modifiers:** inherited

Inherited from [SiDateInputDirective](<../../../api/siemens/element-ng/directives/SiDateInputDirective/index.html#SiDateInputDirective>)

Implements `ControlValueAccessor`

```
registerOnChange(fn: any): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [fn](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L174-L174>) | `any` |  | The callback function to register |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### registerOnTouched

[Source for registerOnTouched](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L178-L180>)

**Modifiers:** inherited

Inherited from [SiDateInputDirective](<../../../api/siemens/element-ng/directives/SiDateInputDirective/index.html#SiDateInputDirective>)

Implements `ControlValueAccessor`

```
registerOnTouched(fn: () => void): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [fn](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L178-L178>) | `() => void` |  | The callback function to register |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### registerOnValidatorChange

[Source for registerOnValidatorChange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L182-L184>)

**Modifiers:** inherited

Inherited from [SiDateInputDirective](<../../../api/siemens/element-ng/directives/SiDateInputDirective/index.html#SiDateInputDirective>)

Implements `Validator`

```
registerOnValidatorChange(fn: () => void): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [fn](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L182-L182>) | `() => void` |  | The callback function |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### setDisabledState

[Source for setDisabledState](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L186-L189>)

**Modifiers:** inherited

Inherited from [SiDateInputDirective](<../../../api/siemens/element-ng/directives/SiDateInputDirective/index.html#SiDateInputDirective>)

Implements `ControlValueAccessor`

```
setDisabledState(isDisabled: boolean): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [isDisabled](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L186-L186>) | `boolean` |  | The disabled status to set on the element |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### validate

[Source for validate](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L170-L172>)

**Modifiers:** inherited

Inherited from [SiDateInputDirective](<../../../api/siemens/element-ng/directives/SiDateInputDirective/index.html#SiDateInputDirective>)

Implements `Validator`

```
validate(c: AbstractControl<any, any, any>): ValidationErrors | null
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [c](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L170-L170>) | `AbstractControl<any, any, any>` |  | The control to validate against. |

**Returns:** [ValidationErrors](<https://angular.dev/api/forms/ValidationErrors>)`  |  `[null](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null>)

##### writeValue

[Source for writeValue](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L191-L215>)

**Modifiers:** inherited

Inherited from [SiDateInputDirective](<../../../api/siemens/element-ng/directives/SiDateInputDirective/index.html#SiDateInputDirective>)

Implements `ControlValueAccessor`

```
writeValue(value?: string | Date | null): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [value](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-date-input.directive.ts#L191-L191>) (optional) | `string \| Date \| null` |  | The new value for the element |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

### Types Documentation

### [DatepickerConfig](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L11-L104>)

**Kind:** interface

```
import type { DatepickerConfig } from '@siemens/element-ng/datepicker';
```

```
interface DatepickerConfig
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [disabledTime](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L48-L48>) (optional) | `boolean` | Defines the time is disabled when visible. Will also be updated on user change. Default is `false`. |
| [disabledTimeText](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L56-L56>) (optional) | `TranslatableString` | Text or translation key for the `disabled` disable time. Default is `Ignore time`. |
| [enableDateRange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L68-L68>) (optional) | `boolean` | Options to turn on date range selection. |
| [enabledTimeText](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L52-L52>) (optional) | `TranslatableString` | Text or translation key for the `enabled` disable time. Default is `Consider time`. |
| [enableTimeValidation](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L76-L76>) (optional) | `boolean` | Consider time with minDate and maxDate |
| [enableTwoMonthDateRange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L72-L72>) (optional) | `boolean` | Option to use two months view for date range picking. |
| [endTimeLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L103-L103>) (optional) | `string` |  |
| [hideLabels](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L86-L86>) (optional) | `boolean` |  |
| [hideWeekNumbers](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L23-L23>) (optional) | `boolean` | Configuration for hiding week numbers. Default is `false`. |
| [hoursAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L88-L88>) (optional) | `string` |  |
| [hoursLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L82-L82>) (optional) | `string` |  |
| [hoursPlaceholder](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L93-L93>) (optional) | `string` |  |
| [mandatoryTime](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L44-L44>) (optional) | `boolean` | Hides disable time switch in the timepicker part and includes mandatory the time in the picker. |
| [maxDate](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L64-L64>) (optional) | `Date` | Maximal (latest) selectable date. |
| [meridians](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L98-L98>) (optional) | `string[]` |  |
| [meridiansAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L100-L100>) (optional) | `string` |  |
| [meridiansLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L99-L99>) (optional) | `string` |  |
| [millisecondsAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L91-L91>) (optional) | `string` |  |
| [millisecondsLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L85-L85>) (optional) | `string` |  |
| [millisecondsPlaceholder](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L96-L96>) (optional) | `string` |  |
| [minDate](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L60-L60>) (optional) | `Date` | Minimal (earliest) selectable date. |
| [minutesAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L89-L89>) (optional) | `string` |  |
| [minutesLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L83-L83>) (optional) | `string` |  |
| [minutesPlaceholder](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L94-L94>) (optional) | `string` |  |
| [onlyMonthSelection](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L80-L80>) (optional) | `boolean` | Only month and year are selectable. |
| [secondsAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L90-L90>) (optional) | `string` |  |
| [secondsLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L84-L84>) (optional) | `string` |  |
| [secondsPlaceholder](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L95-L95>) (optional) | `string` |  |
| [showMilliseconds](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L39-L39>) (optional) | `boolean` | Defines the timepicker milliseconds visibility . Default is `false`. |
| [showMinutes](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L31-L31>) (optional) | `boolean` | Defines the timepicker minutes visibility. Default is `true`. |
| [showSeconds](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L35-L35>) (optional) | `boolean` | Defines the timepicker seconds visibility . Default is `false`. |
| [showTime](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L27-L27>) (optional) | `boolean` | Defines the timepicker visibility. Default is `false`. |
| [startTimeLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L102-L102>) (optional) | `string` |  |
| [todayText](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L15-L15>) (optional) | `TranslatableString` | Text or translation key for today button title. Default is `Today`. |
| [weekStartDay](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L19-L19>) (optional) | `WeekStart` | Defines the starting day of the week. Default is `monday`. |

### [DatepickerInputConfig](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L106-L121>)

**Kind:** interface

```
import type { DatepickerInputConfig } from '@siemens/element-ng/datepicker';
```

```
interface DatepickerInputConfig extends DatepickerConfig
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [dateFormat](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L120-L120>) (optional) | `string` | Similar to `dateTimeFormat`, but used when only a date is displayed (e.g. when `showTime === false` or `disabledTime === true`). Only numeric date formats are supported. |
| [dateTimeFormat](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L114-L114>) (optional) | `string` | A custom date/time format according the Angular date pipe (see [https://angular.dev/api/common/DatePipe](<https://angular.dev/api/common/DatePipe>)). Only numeric date formats are supported. The format is used to render the time of a date-time criterion. If not specified, `mediumTime` is used if the `showSeconds` flag is true, otherwise `shortTime` as default. For the date-only case, 'shortDate' is used. |
| [disabledTime](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L48-L48>) (optional, inherited) | `boolean` | Defines the time is disabled when visible. Will also be updated on user change. Default is `false`.<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [disabledTimeText](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L56-L56>) (optional, inherited) | `TranslatableString` | Text or translation key for the `disabled` disable time. Default is `Ignore time`.<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [enableDateRange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L68-L68>) (optional, inherited) | `boolean` | Options to turn on date range selection.<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [enabledTimeText](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L52-L52>) (optional, inherited) | `TranslatableString` | Text or translation key for the `enabled` disable time. Default is `Consider time`.<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [enableTimeValidation](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L76-L76>) (optional, inherited) | `boolean` | Consider time with minDate and maxDate<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [enableTwoMonthDateRange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L72-L72>) (optional, inherited) | `boolean` | Option to use two months view for date range picking.<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [endTimeLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L103-L103>) (optional, inherited) | `string` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [hideLabels](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L86-L86>) (optional, inherited) | `boolean` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [hideWeekNumbers](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L23-L23>) (optional, inherited) | `boolean` | Configuration for hiding week numbers. Default is `false`.<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [hoursAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L88-L88>) (optional, inherited) | `string` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [hoursLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L82-L82>) (optional, inherited) | `string` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [hoursPlaceholder](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L93-L93>) (optional, inherited) | `string` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [mandatoryTime](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L44-L44>) (optional, inherited) | `boolean` | Hides disable time switch in the timepicker part and includes mandatory the time in the picker.<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [maxDate](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L64-L64>) (optional, inherited) | `Date` | Maximal (latest) selectable date.<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [meridians](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L98-L98>) (optional, inherited) | `string[]` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [meridiansAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L100-L100>) (optional, inherited) | `string` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [meridiansLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L99-L99>) (optional, inherited) | `string` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [millisecondsAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L91-L91>) (optional, inherited) | `string` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [millisecondsLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L85-L85>) (optional, inherited) | `string` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [millisecondsPlaceholder](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L96-L96>) (optional, inherited) | `string` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [minDate](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L60-L60>) (optional, inherited) | `Date` | Minimal (earliest) selectable date.<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [minutesAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L89-L89>) (optional, inherited) | `string` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [minutesLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L83-L83>) (optional, inherited) | `string` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [minutesPlaceholder](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L94-L94>) (optional, inherited) | `string` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [onlyMonthSelection](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L80-L80>) (optional, inherited) | `boolean` | Only month and year are selectable.<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [secondsAriaLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L90-L90>) (optional, inherited) | `string` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [secondsLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L84-L84>) (optional, inherited) | `string` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [secondsPlaceholder](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L95-L95>) (optional, inherited) | `string` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [showMilliseconds](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L39-L39>) (optional, inherited) | `boolean` | Defines the timepicker milliseconds visibility . Default is `false`.<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [showMinutes](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L31-L31>) (optional, inherited) | `boolean` | Defines the timepicker minutes visibility. Default is `true`.<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [showSeconds](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L35-L35>) (optional, inherited) | `boolean` | Defines the timepicker seconds visibility . Default is `false`.<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [showTime](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L27-L27>) (optional, inherited) | `boolean` | Defines the timepicker visibility. Default is `false`.<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [startTimeLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L102-L102>) (optional, inherited) | `string` | Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [todayText](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L15-L15>) (optional, inherited) | `TranslatableString` | Text or translation key for today button title. Default is `Today`.<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |
| [weekStartDay](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L19-L19>) (optional, inherited) | `WeekStart` | Defines the starting day of the week. Default is `monday`.<br><br>Inherited from [DatepickerConfig](<index.html#t:DatepickerConfig>) |

### [DateRange](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L170-L173>)

**Kind:** type alias

```
import type { DateRange } from '@siemens/element-ng/datepicker';
```

```
type DateRange = {
  start: Date | undefined;
  end: Date | undefined;
}
```

### [RangeType](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.component.ts#L60-L60>)

**Kind:** type alias

```
import type { RangeType } from '@siemens/element-ng/datepicker';
```

```
type RangeType = 'START' | 'END' | undefined
```

### [TranslatableString](<https://github.com/siemens/element/blob/main/projects/element-translate-ng/translate-types/global.types.ts#L18-L18>)

**Kind:** type alias

```
import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';
```

Represents a translatable string. This can either be a translation key, e.g. `ACTIONS.EDIT` that will be automatically translated when displayed on the UI or a pre-translated string, e.g. `Edit`. Equivalent to a normal string in usage and functionality.

```
type TranslatableString = string & Translatable
```

### [CloseCause](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker-overlay.directive.ts#L29-L34>)

**Kind:** enum

```
import { CloseCause } from '@siemens/element-ng/datepicker';
```

```
enum CloseCause
```

#### Members

##### Backdrop

[Source for Backdrop](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker-overlay.directive.ts#L30-L30>)

**Type:** `CloseCause.Backdrop`

**Default:** `'backdrop'`

##### Detach

[Source for Detach](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker-overlay.directive.ts#L31-L31>)

**Type:** `CloseCause.Detach`

**Default:** `'detach'`

##### Escape

[Source for Escape](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker-overlay.directive.ts#L32-L32>)

**Type:** `CloseCause.Escape`

**Default:** `'escape'`

##### Select

[Source for Select](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker-overlay.directive.ts#L33-L33>)

**Type:** `CloseCause.Select`

**Default:** `'select'`

### [SiFormItemControl](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-item.control.ts#L14-L38>)

**Kind:** interface

```
import type { SiFormItemControl } from '@siemens/element-ng/form';
```

Common interface for form item controls. Controls that should be connected to [SiFormItemComponent](<../../../api/siemens/element-ng/components/SiFormItemComponent/index.html#SiFormItemComponent>) must implement this interface and must be provided using the [SI\_FORM\_ITEM\_CONTROL](<../../../api/siemens/element-ng/types/SI_FORM_ITEM_CONTROL/index.html#t:SI_FORM_ITEM_CONTROL>) token.

```
interface SiFormItemControl
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [errormessageId](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-item.control.ts#L34-L34>) (readonly) | `string \| Signal<string>` | Generated ID that the [SiFormItemComponent](<../../../api/siemens/element-ng/components/SiFormItemComponent/index.html#SiFormItemComponent>) will assign to the element containing the error messages. Implementations of [SiFormItemControl](<index.html#t:SiFormItemControl>) must generate this ID and assign it to the `aria-describedby` attribute of their focusable elements. |
| [id](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-item.control.ts#L16-L16>) (optional, readonly) | `string \| Signal<string \| undefined>` | The actual id of the control that should be used in the `for` attribute of a label. |
| [isFormCheck](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-item.control.ts#L37-L37>) (optional, readonly) | `boolean` | If the control is meant to be used a checkbox. This affects the label positioning. |
| [labelledby](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-item.control.ts#L27-L27>) (optional, readonly) | `string \| Signal<string \| undefined> \| null` | ID that should be assigned to the label element inside the [SiFormItemComponent](<../../../api/siemens/element-ng/components/SiFormItemComponent/index.html#SiFormItemComponent>).<br><br>If the target control is not of type input, select or button, it cannot be referenced by a label. Instead, aria-labelledby must be used to create a reference to a label. In such a case, an implementation of [SiFormItemControl](<index.html#t:SiFormItemControl>) must provide the id of the label in [labelledby](<index.html#t:SiFormItemControl.labelledby>). [SiFormItemComponent](<../../../api/siemens/element-ng/components/SiFormItemComponent/index.html#SiFormItemComponent>) will apply the id to the label so that it can be used inside the control to reference it in the aria-labelledby attribute. |

### [WeekStart](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L9-L9>)

**Kind:** type alias

```
import type { WeekStart } from '@siemens/element-ng/datepicker';
```

```
type WeekStart = 'monday' | 'saturday' | 'sunday' | undefined
```
