This is a combined version of DatePicker iOS and Android and Windows plugin for Cordova/Phonegap 4.0.
Original iOS version: https://github.com/sectore/phonegap3-ios-datepicker-plugin
Original Android version: https://github.com/bikasv/cordova-android-plugins/tree/master/datepicker
Make sure that you have Node and Cordova CLI or PhoneGap's CLI installed on your machine.
Add a plugin to your project using Cordova CLI:
cordova plugin add https://github.com/VitaliiBlagodir/cordova-plugin-datepicker
Or using PhoneGap CLI:
phonegap local plugin add https://github.com/VitaliiBlagodir/cordova-plugin-datepicker
var options = {
date: new Date(),
mode: 'date'
};
datePicker.show(options, function(date){
alert("date result " + date);
});
The mode of the date picker.
Type: String
Values: date
| time
| datetime
(iOS, Windows only)
Default: date
Selected date.
Type: String
Default: new Date()
Minimum date.
Type: Date | empty String
Default: (empty String)
minDate is a Date object for iOS and an integer for Android, so you need to account for that when using the plugin.
Maximum date.
Type: Date | empty String
Default: (empty String)
Shows or hide dates earlier then selected date.
Type: Boolean
Values: true
| false
Default: true
Shows or hide dates after selected date.
Type: Boolean
Values: true
| false
Default: true
Label of done button.
Typ: String
Default: Done
Hex color of done button.
Typ: String
Default: #0000FF
Label of cancel button.
Type: String
Default: Cancel
Hex color of cancel button.
Type: String
Default: #000000
X position of date picker. The position is absolute to the root view of the application.
Type: String
Default: 0
Y position of date picker. The position is absolute to the root view of the application.
Type: String
Default: 0
Interval between options in the minute section of the date picker.
Type: Integer
Default: 1
var options = {
date: new Date(),
mode: 'date'
};
datePicker.show(options, function(date){
alert("date result " + date);
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。