mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 12:15:37 +08:00
Second Updates from Wed 25 Mar
- [MAdMan][Android] Make things look more Androidy | Philipp von Weitershausen - flowified Libraries from Avik | Basil Hosmer - flowify some Libraries | Basil Hosmer - [ReactKit] Add shake development menu | Alex Kotliarskyi - [ReactNative] Add debugger and change SampleApp files structure | Alex Kotliarskyi - Flowify ReactIOSEventEmitter | Marshall Roch - [react_native] JS files from D1941151: Allow fontWeight to be 100,200,...,900 | Krzysztof Magiera
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @providesModule DatePickerIOS
|
||||
* @flow
|
||||
*
|
||||
* This is a controlled component version of RCTDatePickerIOS
|
||||
*/
|
||||
@@ -26,6 +27,12 @@ var merge = require('merge');
|
||||
|
||||
var DATEPICKER = 'datepicker';
|
||||
|
||||
type DefaultProps = {
|
||||
mode: 'date' | 'time' | 'datetime';
|
||||
};
|
||||
|
||||
type Event = Object;
|
||||
|
||||
/**
|
||||
* Use `DatePickerIOS` to render a date/time picker (selector) on iOS. This is
|
||||
* a controlled component, so you must hook in to the `onDateChange` callback
|
||||
@@ -85,13 +92,13 @@ var DatePickerIOS = React.createClass({
|
||||
timeZoneOffsetInMinutes: PropTypes.number,
|
||||
},
|
||||
|
||||
getDefaultProps: function() {
|
||||
getDefaultProps: function(): DefaultProps {
|
||||
return {
|
||||
mode: 'datetime',
|
||||
};
|
||||
},
|
||||
|
||||
_onChange: function(event) {
|
||||
_onChange: function(event: Event) {
|
||||
var nativeTimeStamp = event.nativeEvent.timestamp;
|
||||
this.props.onDateChange && this.props.onDateChange(
|
||||
new Date(nativeTimeStamp)
|
||||
|
||||
Reference in New Issue
Block a user