/cordova-plugin-datetimepicker

Native 📅 date and 🕓 time picker for Cordova Android apps.

Primary LanguageJavaMIT LicenseMIT

npm npm GitHub package.json version GitHub code size in bytes GitHub top language GitHub last commit

Platforms

  • Android
  • Browser

Installation

cordova plugins add cordova-plugin-datetimepicker

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
};
cordova.plugins.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

Changelog

v2.0.0

  • Added the browser platform (for date selection only)
  • Plugin methods moved from window to cordova.plugins.