Skip to content

Month picker ​

Twelve tiles for a year. The value is `2026-12`. Month names come from the browser, in the language you set.

The code ​

import { createDatePicker } from '@nervure/datetime';

createDatePicker('#field', {
  mode: 'month',
  value: '2026-12',
  onChange: (selection) => console.log(selection.value, selection.start, selection.end),
});

The value is '2026-12'. Read the guide for every option, and see every example.

What it does ​

  • The selection gives the first instant of the month and of the next one.
  • The year title opens twelve years at a time.

Why this one ​

  • No dependency, about 18 kB gzipped for every mode, zone and language.
  • Values are ISO 8601 text. Each selection also gives two instants, start and end, in the time zone.
  • 28 languages and right to left. Keyboard and screen readers.
  • Your CSS and your colours, through CSS variables. Light and dark.
  • The same picker in plain JavaScript, as a web component, in React and in Vue.