AirDatePicker

in namespace DotVVM.Bootstrap5.AirDatePicker.Controls

A Bootstrap 5-styled date/time picker backed by AIR Datepicker.

Usage & Scenarios

Renders a Bootstrap 5-styled input using the AIR Datepicker widget. It supports date, time, and combined date-time selection with a nullable DateTime SelectedValue binding.

Install the DotVVM.Controls.Bootstrap5.AirDatePicker package and register it in DotvvmStartup.cs after Bootstrap 5:

config.AddBootstrap5Configuration();
config.AddBootstrap5AirDatePickerConfiguration();

Use Type to choose Date, Time, or DateTime. DateFormat and TimeFormat use .NET format strings; supported date tokens are d, dd, MMM, MMMM, yy, and yyyy, and supported time tokens are h, hh, H, HH, m, mm, and tt.

Sample 1: Date, Time, and Date-Time Pickers

Use AirDatePicker with the default Date type for dates, or set Type to Time or DateTime. MinHours, MaxHours, and MinutesStep constrain time selection.

<div class="d-grid gap-3" style="max-width: 28rem">
    <bs:AirDatePicker SelectedValue="{value: MeetingDate}"
                      Placeholder="Choose a date" />

    <bs:AirDatePicker SelectedValue="{value: MeetingTime}"
                      Type="Time"
                      TimeFormat="HH:mm"
                      MinHours="8"
                      MaxHours="18"
                      MinutesStep="15"
                      Placeholder="Choose a time" />

    <bs:AirDatePicker SelectedValue="{value: PublishedAt}"
                      Type="DateTime"
                      DateFormat="dd.MM.yyyy"
                      TimeFormat="HH:mm"
                      Culture="cs-CZ"
                      Placeholder="Choose date and time" />
</div>

<p>Date: <strong>{{value: MeetingDate}}</strong></p>
<p>Time: <strong>{{value: MeetingTime}}</strong></p>
<p>Date and time: <strong>{{value: PublishedAt}}</strong></p>
using DotVVM.Framework.ViewModel;
using System;

namespace DotvvmWeb.Views.Docs.Controls.bootstrap5_airdatepicker.AirDatePicker.sample1
{
    public class ViewModel : DotvvmViewModelBase
    {
        public DateTime? MeetingDate { get; set; } = new DateTime(2026, 7, 1);

        public DateTime? MeetingTime { get; set; } = new DateTime(2026, 1, 1, 9, 30, 0);

        public DateTime? PublishedAt { get; set; } = new DateTime(2026, 7, 1, 14, 0, 0);
    }
}

Properties

Name Type Description Notes Default Value
property icon Culture String Gets or sets the culture name used for localization. When omitted, is used.
attribute
inner element
static value
bindable
default
null
property icon DateFormat String Gets or sets the .NET date format string used for display. Supported tokens: d, M, and y.
attribute
inner element
static value
bindable
default
null
property icon Enabled Boolean Gets or sets whether the input is enabled.
attribute
inner element
static value
bindable
default
null
property icon HoursStep Int32? Gets or sets the hour step used by the time picker.
attribute
inner element
static value
bindable
default
null
property icon MaxDate DateTime? Gets or sets the maximum selectable date and time.
attribute
inner element
static value
bindable
default
null
property icon MaxHours Int32 Gets or sets the maximum selectable hour when time selection is enabled.
attribute
inner element
static value
bindable
default
null
property icon MinDate DateTime? Gets or sets the minimum selectable date and time.
attribute
inner element
static value
bindable
default
null
property icon MinHours Int32 Gets or sets the minimum selectable hour when time selection is enabled.
attribute
inner element
static value
bindable
default
null
property icon MinutesStep Int32? Gets or sets the minute step used by the time picker.
attribute
inner element
static value
bindable
default
null
property icon Placeholder String Gets or sets the placeholder text shown when no value is selected.
attribute
inner element
static value
bindable
default
null
property icon SelectedValue IValueBinding<DateTime?> Gets or sets the selected date and time value bound to the control.
attribute
inner element
static value
bindable
default
null
property icon Size Size Size Gets or sets the size of the input.
attribute
inner element
static value
bindable
default
Default
property icon TimeFormat String Gets or sets the .NET time format string used for display. Accepted tokens are limited to h, H, m, s, and t.
attribute
inner element
static value
bindable
default
null
property icon Type AirDatePickerType AirDatePickerType Gets or sets whether the control displays a date picker, time picker, or both.
attribute
inner element
static value
bindable
default
Date
property icon Visible Boolean Gets or sets whether the control is visible. When set to false, `style="display: none"` will be added to this control.
attribute
inner element
static value
bindable
default
True

HTML produced by the control