Cordova DatePicker Plugin
npm install cordova-plugin-cartegraph-datepickerThis plugin is a fork of Vitalii Blagodir's cordova-date-picker plugin, which is a combined version of DatePicker iOS and Android and Windows plugin for Cordova/Phonegap 4.0.
- Vitalii Blagodir's version: https://github.com/VitaliiBlagodir/cordova-plugin-datepicker
- Original iOS version: https://github.com/sectore/phonegap3-ios-datepicker-plugin
- Original Android version: https://github.com/bikasv/cordova-android-plugins/tree/master/datepicker
New in 0.9.0 (this fork):
- Added a clear button and removed the now button
New in 0.8.0 (Android Only):
- Android code refactored
- Option datetime added (default if mode is unknown), opening a new time dialog after setting the date
- Options okText and cancelText to define the labels for POSITIVE and NEGATIVE buttons
- Option todayText to set the label of a button that selects current date (date and datetime)
- Option nowText to set the label of a button that selects current time (time and datetime)
- Option is24Hour added
- Local development workflow using Cordova CLI
``bash`
cordova plugin add cordova-plugin-cartegraph-datepicker
- Local development workflow using PhoneGap CLI
`bash`
phonegap local plugin add cordova-plugin-cartegraph-datepicker
- Cloud-based development workflow using PhoneGap Build
`bash`
`js
var options = {
date: new Date(),
mode: 'date'
};
function onSuccess(date) {
alert('Selected date: ' + date);
}
function onError(error) { // Android only
alert('Error: ' + error);
}
datePicker.show(options, onSuccess, onError);
`
Type: String
Values: date | time | datetime (iOS, Windows only)
Default: date
Type: String
Default: new Date()
Type: Date | empty String
Default: (empty String)
minDate is a Date object for iOS and a millisecond precision unix timestamp for Android, so you need to account for that when using the plugin. Also, on Android, only the date is enforced (time is not).
Type: Date | empty String
Default: (empty String)
Type: String | empty String
Default: (empty String)
Type: String | empty String
Default: (empty String)
Type: String | empty String
Default: (empty String)
Type: String | empty String
Default: (empty String)
Type: String | empty String
Default: (empty String)
Type: Boolean
Values: true | false
Default: false
Type: Int
Values: THEME_TRADITIONAL | THEME_HOLO_DARK | THEME_HOLO_LIGHT | THEME_DEVICE_DEFAULT_DARK | THEME_DEVICE_DEFAULT_LIGHT
Default: THEME_TRADITIONAL
Type: Boolean
Values: true | false
Default: true
Type: Boolean
Values: true | false
Default: true
Typ: String
Default: Done
Typ: String
Default: #0000FF
Type: String
Default: Cancel
Type: String
Default: #000000
Type: String
Default: 0
Type: String
Default: 0
Type: Integer
Default: 1
will revert to default UIPopoverArrowDirectionAny and let the app choose the proper direction itself.Values:
up | down | left | right | anyType: String
Default:
any$3
Force locale for datePicker.Type: String
Default:
en_us`