Skip to content

Native πŸ“… date and πŸ•“ time picker for Cordova Android apps.

License

Notifications You must be signed in to change notification settings

alex-pl/cordova-plugin-datetimepicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

npm version

Cordova Plugin DateTimePicker

Native date and time picker for Android.

Installation

cordova plugins add cordova-plugin-datetimepicker --save

Usage

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);
});

Screenshots

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.

Date Picker Time Picker

Development

# 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