Skip to content

Instantly share code, notes, and snippets.

@mkonicek
Created January 20, 2016 14:34
Show Gist options
  • Select an option

  • Save mkonicek/341be83f851439e6bdf7 to your computer and use it in GitHub Desktop.

Select an option

Save mkonicek/341be83f851439e6bdf7 to your computer and use it in GitHub Desktop.
/**
* This exposes the native DatePickerDialogAndroid module as a JS module. This has a function 'open'
* which takes the following parameters:
*
* 1. An options map. Available keys are:
* * `date` (timestamp in milliseconds) the date to show by default
* * `minDate` (timestamp in milliseconds) the minimum date the user should be allowed to select
* * `maxDate` (timestamp in milliseconds) the maximum date the user should be allowed to select
* 2. An error callback
* 3. A success callback; this will be invoked with parameters action, year, month (0-11),
* dayOfMonth, where action is DatePickerDialogAndroid.dateSetAction if the user set a date, or
* DatePickerDialogAndroid.dismissedAction if the user dimissed the picker (in which case year,
* month and day are undefined)
*/
module.exports = require('NativeModules').DatePickerDialogAndroid;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment