Native date and time picker for Android.
cordova plugins add cordova-plugin-datetimepicker --save
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
};
window.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.
# uninstall old version if present
cordova plugins remove cordova-plugin-datetimepicker
# by using --link the Java files are updated instantly (doesn't work for JavaScript)
cordova plugins add --link ../cordova-plugin-datetimepicker
cordova run android --device