- Android
- Browser
cordova plugins add cordova-plugin-datetimepicker
var options = {
type: 'date', // 'date' or 'time', required
date: new Date(), // date or timestamp, default: current date
minDate: new Date(), // date or timestamp
maxDate: new Date() // date or timestamp
};
cordova.plugins.DateTimePicker.pick(options, function (timestamp) {
window.alert(timestamp);
});
The following screenshots were made on a device with Android 6.0. The plugin uses the default styles of the device it's running on.
- Added the browser platform (for date selection only)
- Plugin methods moved from
window
tocordova.plugins
.