Skip to content

Instantly share code, notes, and snippets.

@mkonicek
Created January 20, 2016 14:36
Show Gist options
  • Save mkonicek/7da333f5cff745f00a6e to your computer and use it in GitHub Desktop.
Save mkonicek/7da333f5cff745f00a6e to your computer and use it in GitHub Desktop.
/**
* This exposes the native TimePickerDialogAndroid module as a JS module. This has a function 'open'
* which takes the following parameters:
*
* 1. An options map. Available keys are:
* * `hour` (0-23) the hour to show, defaults to the current time
* * `minute` (0-59) the minute to show, defaults to the current time
* * `is24Hour` (boolean) if true, forces the picker to be in military time; if false, forces the
* picker to show 12 hours and an AM/PM chooser; if undefined, the default for the
* current locale is used
* 2. An error callback
* 3. A success callback; this will be invoked with parameters action, hour (0-23) and minute, where
* action is TimePickerDialogAndroid.timeSetAction if the user set a time, or
* DatePickerDialogAndroid.dismissedAction if the user dimissed the picker (in which case hour
* and minute are undefined)
*/
module.exports = require('NativeModules').TimePickerDialogAndroid;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment