From e8ae0db44cdab543683177ae63dd75de8fd2e2cc Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Mon, 15 Feb 2016 17:05:37 -0500 Subject: [PATCH 1/4] Added .idea for webstorm --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c2658d7d1..a5199f687 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules/ +.idea \ No newline at end of file From 9e62d791c516e113dd30d04227eac55ece66d04b Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Mon, 15 Feb 2016 17:22:50 -0500 Subject: [PATCH 2/4] Added DatePicker plugin --- src/plugins/datepicker.ts | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/plugins/datepicker.ts diff --git a/src/plugins/datepicker.ts b/src/plugins/datepicker.ts new file mode 100644 index 000000000..893afed30 --- /dev/null +++ b/src/plugins/datepicker.ts @@ -0,0 +1,60 @@ +import {Plugin, Cordova} from './plugin'; + +/** + * The DatePicker plugin allows the user to fetch date or time using native dialogs. + * + * Platforms supported: iOS, Android, Windows + * + * Requires cordova-plugin-datepicker by VitaliiBlagodir that can be [found here](https://github.com/VitaliiBlagodir/cordova-plugin-datepicker). + * + * Install the plugin by running the following command: + * ```shell + * ionic plugin add cordova-plugin-datepicker + * ``` + * + * @usage + * ```js + * DatePicker. + * ``` + * + */ +@Plugin({ + name: 'DatePicker', + plugin: '', + pluginRef: '' +}) +export class DatePicker { + + /** + * Shows the date and/or time picker dialog(s) + * @param options + * @returns {Promise} Returns a promise that resolves with the picked date and/or time, or rejects with an error. + */ + static show(options? : { + mode : string, + date : string, + minDate : string, + maxDate : string, + titleText : string, + okText : string, + cancelText : string, + todayText : string, + nowText : string, + is24Hour : boolean, + androidTheme : number, + allowOldDate: boolean, + allowFutureDates : boolean, + doneButtonLabel : string, + doneButtonColor : string, + cancelButtonLabel : string, + cancelButtonColor : string, + x : string, + y : string, + minuteInterval : number, + popoverArrowDirection : string, + locale : string + }) : Promise { + return new Promise((res, rej) => {}); + } + +} \ No newline at end of file From 5afa58fee4d89c3266fa8049274892e807d99439 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Mon, 15 Feb 2016 17:25:15 -0500 Subject: [PATCH 3/4] feat(DatePicker): Added DatePicker --- src/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 542073f07..5c42a0830 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,6 +19,7 @@ import {Push} from './plugins/push'; import {StatusBar} from './plugins/statusbar'; import {Toast} from './plugins/toast'; import {TouchID} from './plugins/touchid'; +import {DatePicker} from './plugins/datepicker'; export { ActionSheet, @@ -33,7 +34,8 @@ export { Push, StatusBar, Toast, - TouchID + TouchID, + DatePicker } // Window export to use outside of a module loading system @@ -50,7 +52,8 @@ window['IonicNative'] = { Push: Push, StatusBar: StatusBar, Toast: Toast, - TouchID: TouchID + TouchID: TouchID, + DatePicker: DatePicker } // To help developers using cordova, we listen for the device ready event and From 499ead3aae5df2de29da1eccfb6d663ee3d9f418 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Wed, 17 Feb 2016 02:23:56 -0500 Subject: [PATCH 4/4] fix(): datepicker plugin, pluginref, and @Cordova wrapper --- src/plugins/datepicker.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/datepicker.ts b/src/plugins/datepicker.ts index 893afed30..4c55dd8c9 100644 --- a/src/plugins/datepicker.ts +++ b/src/plugins/datepicker.ts @@ -20,8 +20,8 @@ import {Plugin, Cordova} from './plugin'; */ @Plugin({ name: 'DatePicker', - plugin: '', - pluginRef: '' + plugin: 'cordova-plugin-datepicker', + pluginRef: 'plugins.datePicker' }) export class DatePicker { @@ -30,6 +30,7 @@ export class DatePicker { * @param options * @returns {Promise} Returns a promise that resolves with the picked date and/or time, or rejects with an error. */ + @Cordova static show(options? : { mode : string, date : string,