Date Picker
$ ionic plugin add cordova-plugin-datepicker
Repo: https://github.com/VitaliiBlagodir/cordova-plugin-datepicker
The DatePicker plugin allows the user to fetch date or time using native dialogs.
Platforms supported: iOS, Android, Windows
Requires Cordova plugin: cordova-plugin-datepicker
. For more info, please see the DatePicker plugin docs.
Usage
import {DatePicker} from 'ionic-native';
DatePicker.show({
date: new Date(),
mode: 'date'
}).then(
date => console.log("Got date: ", date),
err => console.log("Error occurred while getting date:", err)
);
Static Methods
show(options)
Shows the date and/or time picker dialog(s)
Param | Type | Details |
---|---|---|
options |
Returns:
Promise<Date>
Returns a promise that resolves with the picked date and/or time, or rejects with an error.