Skip to main content
iVentureTeam

datetime-picker

Despite the name, datetime-picker is not something you put in a widget= attribute on a form view. It is a website side interaction that upgrades any frontend <input> carrying data-widget="datetime-picker" into Odoo's calendar picker.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 20, 2026Updated August 20, 20264 min read
Technical namedatetime-picker
Field typesnone (attaches to an HTML input, not a record field)
Viewswebsite frontend (QWeb templates, portal and survey pages)
Also registered asregistered in the public.interactions registry as web.datetime_picker (not in the fields registry)
Moduleweb, active on website frontend pages
Used in core4 occurrences across 2 modules: survey (activity deadline inputs), website_crm_partner_assign
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0
No-code setupNo. It is wired through HTML data attributes in QWeb templates, not through Studio.
Alternativesdatetime, date, daterange

What the datetime-picker interaction does

Most entries in this reference are field widgets: components you activate with widget="..." in a backend view. datetime-picker is the exception. If you write widget="datetime-picker" on a form view field, nothing happens, because the name is never registered in the fields registry.

What ships under this name is a frontend interaction in the web module. On public website pages, Odoo scans the DOM for elements matching the selector [data-widget='datetime-picker'] and mounts the same calendar picker service the backend uses (datetime_picker) onto each match. The element's existing value is parsed with the user's locale (parseDate or parseDateTime), and optional minimum and maximum bounds are deserialized from data attributes.

In Odoo core you meet it on survey pages, where deadline inputs carry data-widget="datetime-picker" data-widget-type="date", and in the partner assignment portal.

What this means for your team

For anyone building customer facing forms on an Odoo website, this is the zero JavaScript way to get a proper date picker: one data attribute on the input and visitors get the same polished calendar employees see in the backend, localized to their language and date format.

The practical win is consistency. Portal deadline forms, event registration extras and custom snippet forms all pick dates the same way, and the values arrive in formats the server side parsing already understands, which kills a whole class of my customer typed 13/02/2026 bugs.

Supported options in Odoo 19

The interaction declares no options object; it reads exactly three HTML data attributes from the element it mounts on, all visible in the 19.0 source. They are listed here in the options table with attribute semantics.

OptionTypeWhat it does
data-widget-type (attribute)string: date | datetimeHTML data attribute. Chooses date only or date plus time mode; it also selects which parser reads the input's initial value (parseDate vs parseDateTime). Any value other than date falls back to datetime.(default: datetime)
data-min-date (attribute)serialized date stringHTML data attribute. Lower bound for selectable dates, deserialized with the server format (YYYY-MM-DD or YYYY-MM-DD HH:mm:ss depending on mode) before being passed to the picker.
data-max-date (attribute)serialized date stringHTML data attribute. Upper bound for selectable dates, deserialized the same way as data-min-date.

These are HTML data attributes on the input element, not view options. data-min-date and data-max-date must be server serialized date strings; they are run through deserializeDate or deserializeDateTime, so human formats like 31/12/2026 will not parse.

Working examples

A date only input as the survey templates ship it:

<input type="text" data-widget="datetime-picker" data-widget-type="date"
       name="date_deadline" class="datetimepicker-input form-control"/>

A full datetime input with bounds, in a custom QWeb template:

<input type="text" data-widget="datetime-picker"
       data-min-date="2026-01-01 00:00:00"
       data-max-date="2026-12-31 23:59:59"/>

Omitting data-widget-type gives the datetime behavior; there is no time only mode.

PublicWidget to Interaction: the 19.0 rewrite

The 19.0 rewrite matters if you maintain website customizations:

17 and 18: the feature lived in datetime_picker_widget.js as a legacy PublicWidget named DateTimePickerWidget, with the same selector and the same three data attributes. It also declared disabledInEditableMode: true, so the picker stayed inert while editing the page in the website builder.

19: the file became public/datetime_picker.js and the class now extends Interaction, registered as web.datetime_picker in the public.interactions registry. Cleanup is handled through registerCleanup instead of a destroy override. If your code inherited or patched DateTimePickerWidget, that hook point is gone in 19 and you patch the interaction instead.

16: neither file exists; frontend date inputs in 16 relied on per module implementations.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. Present in the development branch with internal cleanup only; see below.
Odoo 19.0VerifiedRewritten as an Interaction (web.datetime_picker); verified against the shipped source.
Odoo 18.0VerifiedLegacy PublicWidget implementation, same selector and data attributes.
Odoo 17.0VerifiedSame PublicWidget implementation as 18.0.
Odoo 16.0Not availableThe shared frontend picker does not exist in 16.0.

The HTML contract (selector plus three data attributes) is identical in 17, 18 and 19, so templates migrate untouched. JavaScript that patched the old PublicWidget class must be rewritten for the Interaction framework in 19.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The changes below are read from the public development branch and are not final until release.

The interaction survives with the same selector and the same three data attributes. The only diff is internal: the cleanup callback registers the picker's destroy handle directly instead of the enable wrapper. No template changes are expected. We will re verify this page against the released branch after the launch.

Common problems and fixes

SymptomCause and fix
widget="datetime-picker" on a form view field does nothingThe name is a public interaction, not a field widget; it is never registered in the fields registry. Use widget="datetime" or widget="date" in backend views; use the data attribute only on website inputs.
The picker does not appear on my website form inputThe element does not match [data-widget='datetime-picker'], or the page does not load the public interactions bundle. Add data-widget="datetime-picker" to the input and confirm the page uses the standard website layout assets.
data-min-date seems ignoredThe value is in a display format; the interaction deserializes server format strings only. Emit the bound as a serialized value, e.g. 2026-12-31 or 2026-12-31 23:59:59.
Custom JS that patched DateTimePickerWidget broke after upgrading to 19The legacy PublicWidget class was replaced by an Interaction registered as web.datetime_picker. Rewrite the patch against the interaction class in web/static/src/public/datetime_picker.js.

Datetime-picker interaction vs the alternatives

WidgetBest forKey difference
datetime-pickerDate and datetime inputs on public website and portal pagesActivated by an HTML data attribute in QWeb templates, not by widget= in view XML
datetimeDatetime fields in backend viewsReal field widget with options like show_seconds and range pairing
dateDate only fields in backend viewsField widget bound to record data, no HTML attributes involved
daterangeStart and end date pairs on one lineLinks two backend fields into a single range popover

Reach for this interaction on public pages only. Inside backend views, dates already come with pickers through the widgets below, and none of them need data attributes.

Frequently asked questions

Is datetime-picker an Odoo field widget?+
No. It is a public interaction in the web module that upgrades frontend inputs marked with data-widget="datetime-picker". In backend form views use widget="datetime" or widget="date" instead.
How do I add an Odoo date picker to a website form?+
Add data-widget="datetime-picker" to the <input> in your QWeb template, plus data-widget-type="date" if you want a date only picker. The standard website assets do the rest.
How do I limit the selectable dates?+
Set data-min-date and data-max-date on the input, using server serialized values such as 2026-12-31. The interaction deserializes them and passes them to the picker as bounds.
Where does Odoo core use datetime-picker?+
Four places in 19.0: the survey module's deadline and activity date inputs, and the website_crm_partner_assign portal. All are plain inputs carrying the data attribute.
Did the implementation change recently?+
Yes. In 17 and 18 it was a legacy PublicWidget (DateTimePickerWidget); Odoo 19 rewrote it as an Interaction registered as web.datetime_picker. The HTML contract stayed identical, only JavaScript patches need rewriting.

Website forms that collect clean data

Portal deadline forms, booking widgets, custom registration flows: we build Odoo website features where dates arrive valid, localized and bounded, and where an upgrade to the next Odoo version does not break your frontend JavaScript.

Build my portal form

How this page was produced

This page was verified by reading the Odoo 19.0 web module source at static/src/public/datetime_picker.js, the legacy 17.0 and 18.0 datetime_picker_widget.js, and the real usages in survey_templates.xml. The registry name and selector were taken verbatim from the source; the Odoo 20 section comes from the public development branch on the day of writing. Found a mistake? Tell us via our contact page.