Skip to content

Commit

Permalink
fix(datepicker): fix plugin functionality
Browse files Browse the repository at this point in the history
Fixed and tested the core plugin functionality
  • Loading branch information
ihadeed committed Mar 6, 2016
1 parent 91de971 commit 1a778e7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/plugins/datepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ export interface datePickerOptions {
* Platforms: iOS, Android, Windows
* The mode of the date picker
* Values: date | time | datetime
* Default: date
*/
mode?: string,
mode: string,

/**
* Platforms: iOS, Android, Windows
* Selected date
* Default: new Date()
*/
date?: Date,
date: Date,

/**
* Platforms: iOS, Android, Windows
Expand Down Expand Up @@ -79,7 +77,13 @@ export interface datePickerOptions {
*
* @usage
* ```js
* DatePicker.show();
* DatePicker.show({
* date: new Date(),
* mode: 'date'
* }).then(
* date => console.log("Got date: ", date),
* err => console.log("Error occurred while getting date:", err)
* );
* ```
*
*/
Expand All @@ -95,7 +99,7 @@ export class DatePicker {
* @returns {Promise<Date>} Returns a promise that resolves with the picked date and/or time, or rejects with an error.
*/
@Cordova()
static show(options?: datePickerOptions): Promise<Date> {
static show(options: datePickerOptions): Promise<Date> {
// This Promise is replaced by one from the @Cordova decorator that wraps
// the plugin's callbacks. We provide a dummy one here so TypeScript
// knows that the correct return type is Promise, because there's no way
Expand Down

0 comments on commit 1a778e7

Please sign in to comment.