Tesserae

DateTimePicker

Description

The DateTimePicker component provides a native browser widget for selecting date and time values. It is designed for situations where precise date-time input is required and leverages the browser's built-in capabilities. Under the hood, it converts the provided or selected DateTime value to a string format ("yyyy-MM-ddTHH:mm") for proper display and parsing. Use this component when you need to allow users to pick both date and time with built-in validation and customizable constraints. It is part of the Components group in the Tesserae UI library.

Usage

Instantiate a DateTimePicker using the fluent interface via the static helper method in Tesserae.UI. You can provide an initial DateTime value to set a default value, or use various chainable methods to set additional properties like step increment, minimum or maximum dates, or browser fallback behavior.

Below is an example that creates a basic DateTimePicker:

API reference

class

DateTimePicker

public class DateTimePicker : MomentPickerBase<DateTimePicker, DateTime>

A form input for picking a single date together with a time-of-day.

Constructors

Constructor
DateTimePicker
public DateTimePicker(DateTime? dateTime = null) : base("datetime-local", dateTime.HasValue ? FormatDateTime(dateTime.Value) : string.Empty)

Initializes a new instance of this class.

Properties

Property
DateTimePicker.DateTime
public DateTime DateTime

Gets or sets the date time.

Methods

Method
DateTimePicker.WithBrowserFallback
public DateTimePicker WithBrowserFallback()

Adds the pattern attribute to the underlying input element for graceful degradation when retrieving the user selected value on older browsers.

Returns

The current instance of the type.

Samples

DateTimePicker Variants

This sample illustrates the creation of a DateTimePicker with a few configurations like a default future date, step increment, and range limits.

See also

© 2026 Tesserae. All rights reserved.