Skip to content

BbDatePickerInput

Enter a calendar day, range, month, year, or dated time in a labelled segmented field.

import { BbDatePickerInput } from 'bitboss-ui';

On this page

Use it for

Use BbDatePickerInput when people type or pick a date in a labelled form field.

Use something else when

  • BbDatePicker: the calendar opens from your own cell, chip, or button
  • BbCalendar: the calendar sits in the page, always visible, with no field around it
  • BbTimePickerInput: the value is a recurring wall-clock time with no date
  • BbSelect: the choice is a short fixed list of periods

Also see: Validated forms.

Choose the value contract before adding validation or layout.

Passthrough

Hover or tap a part to outline it. The toggles turn on loading, errors and warnings where the component has them; only parts get a row.

Guidance while the control is focused.

Calendar day or instant

Use floating when “2027-01-01” must stay that day everywhere. Use the default offset timestamp for an instant, and utc only when the receiving API requires Z.

Same day, three contracts.

null
null
null

The default emits a local-offset ISO timestamp. utc emits the same instant in UTC. floating emits only YYYY-MM-DD; it cannot be combined meaningfully with utc.

Coming from v2The default timezone output changed

v2 emitted UTC Z timestamps. v3 emits the local offset by default. Add utc to preserve the v2 wire format, or choose floating for a calendar day. Reading accepts all three forms, so stored values do not need rewriting.

For server-rendered pages, seed a floating value or start empty. A zoned instant may display different local digits on the server and in the browser.

A date field

Use a stable id, a visible label, and name when native form submission or FormData must include the value. It posts as one ISO string under that name (2026-11-17, one entry per end of a range); the day, month and year segments post nothing.

Models: {"issuedAt":"2026-08-30","dueAt":"2026-09-29"}

Bind min to another field, as the due date does here, and use readonly for dates the system sets.

Inside a BbForm the field joins the form by its name and checks itself with rules; formless keeps a filter date out of the submitted values. To require it, add rules="required", and the asterisk follows. Inside a form the required prop is a hint that marks the field and checks nothing; outside one it is a native check that shows as the field's error (Without BbForm).

To save, listen to value-commit: it fires after a calendar pick, an arrow-key step, the clear button, and typing once the user leaves the field; a range once both ends are set (how it works). A typed value the field corrects on leaving (snapped to min / max, a range put in order) fires it too.

The label names every part of the field for screen readers: each segment is a spin button heard as "Day, Due date" with its value in words ("March", "Empty"), a range reads as a Start and an End group, and the calendar and clear buttons carry the label too. Give two date fields in one form different labels.

Label, message and state props work as on BbTextInput. variant="none" drops every colour, focus ring included, for a field you style yourself, like the flat search field on BbTextInput.

Date ranges

Set range for a check-in/check-out window and keep the model as an array.

4 nights: ["2026-09-07","2026-09-11"]

Seed and clear it with []. A reversed typed range is swapped on commit and emits end_before_start. :number-of-months="2" opens two months side by side (the phone sheet still shows one).

Bounds and invalid input

Use min and max for a continuous window and selectable for rules such as weekdays or closures.

Bookable Aug 30 to Oct 31. Closed Sep 7, Sep 21, Oct 12.

Type 09/07/2026 and leave the field: the closure is cleared and the field says why.

Malformed bounds throw during setup. A typed disabled date is normalized on commit and reported through error; turn that payload into an application message with errors. Clear the message on active, not on the model update that normalization itself caused.

Other calendar values

Set type="month" or type="year" for calendar labels. They emit YYYY-MM or YYYY, force floating, and ignore timezone props.

Models: {"expiry":"2028-03","founded":"2014"}

type="week" types an ISO week as W37 2026 and emits 2026-W37. Any day in the calendar picks its week, and min or max keep a week only when all seven days fit.

Models: {"delivery":"2026-W37","sprint":["2026-W37","2026-W38"]}

Use type="datetime" only when a time belongs to a specific date.

v-model → 2026-08-31 · v-model:time → 09:30

12-hour fields, quarter-hour column — and still 14:30 in the model.

With floating, bind v-model:time, or the picked time is lost. The companion model is always a 24-hour HH:mm or HH:mm:ss string. A bound with a time, such as min="2026-08-30T14:00", disables the earlier times on that day.

Typing and mobile

Use disable-panel where typing is faster than paging through months, as for a birth date, and disable-writing="mobile" where touch users should pick from the calendar.

Segments follow the plugin's locale: month first for en, day first for it or en-GB, year first for ja. They also follow its calendar and digits: under fa the fields are Persian (۱۴۰۵/۰۸/۱۴), and Japanese and ROC dates add an era field. Any digit set can be typed or pasted, and the value stays an ISO Gregorian string.

ArrowUp and ArrowDown step a segment; in an empty one they start from today (the today prop when you set it, as on BbCalendar). The year stops at its bounds instead of wrapping. Alt+ArrowDown opens the calendar.

Bind v-model:open to open the calendar from code; every close the user makes is written back to it.

On phones, adaptive opens the calendar in a bottom sheet. Pass sheet options through offCanvasProps, or set :adaptive="false" for viewport-independent tests.

Coming from v2Renamed and removed date-field props
  • Replace datetime with type="datetime".
  • Replace allow-writing with the inverted disable-writing.
  • Replace hide-popover with disable-panel.
  • Remove width; constrain the calendar with CSS only when needed.
  • Replace has-warning with has-warnings.

The v2 token not-mobile becomes mobile for the inverted writing prop and desktop for disable-panel.

The adaptive mobile sheet is now enabled by default. Set :adaptive="false" to retain a popover on every viewport.