Skip to content

Getting Started

Terminal window
npm install @capgo/capacitor-date-picker
npx cap sync
import { DatePicker } from '@capgo/capacitor-date-picker';
const result = await DatePicker.present({
mode: 'date',
date: '2026-05-27',
min: '2026-01-01',
max: '2026-12-31',
format: 'yyyy-MM-dd',
title: 'Select date',
});
console.log(result.value);
const result = await DatePicker.present({
mode: 'time',
is24h: true,
minuteStep: 15,
format: 'HH:mm',
title: 'Select time',
});
console.log(result.value);
const result = await DatePicker.present({
mode: 'dateAndTime',
date: '2026-05-27T14:30:00',
format: "yyyy-MM-dd'T'HH:mm:ss",
title: 'Select date and time',
});
const result = await DatePicker.present({
mode: 'yearAndMonth',
date: '2026-05-01',
format: 'yyyy-MM',
title: 'Select month',
});
const range = await DatePicker.presentRange({
start: '2026-05-01',
end: '2026-05-27',
format: 'yyyy-MM-dd',
startTitle: 'Start date',
endTitle: 'End date',
});
console.log(range.start, range.end, range.value);
await DatePicker.hide();
await DatePicker.present({
mode: 'date',
date: '2026-05-27',
title: 'Select date',
ios: {
style: 'inline',
theme: 'light',
},
android: {
theme: 'light',
},
});
OptionDescription
modedate, time, dateAndTime, yearAndMonth, countDownTimer, or range.
dateInitial selected value.
min / maxMinimum and maximum selectable values.
formatOutput format. ISO, Java/Unicode, and common Moment-style formats are supported.
titleDialog title.
localeLocale used by native pickers where supported.
timezoneTimezone used for parsing and formatting.
is24hPrefer 24-hour time.
minuteStepTime picker minute interval.
doneText / cancelTextCustom action labels.

The repository includes a Capacitor example app that opens the native date picker, time picker, range picker, hide(), and plugin version calls.

iOSAndroid
Animated iOS demo of @capgo/capacitor-date-picker opening, selecting a date, and closingAnimated Android demo of @capgo/capacitor-date-picker opening, selecting a date, and closing

The complete API reference is maintained in the package README and TypeScript definitions: