Skip to content

Commit

Permalink
Add Spec for DatePickerAndroid (facebook#24916)
Browse files Browse the repository at this point in the history
Summary:
This PR solves part of this issue: facebook#24875

## Changelog

[General] [Added] - TM Spec for DatePickerAndroid
Pull Request resolved: facebook#24916

Reviewed By: RSNara

Differential Revision: D15425864

Pulled By: fkgozali

fbshipit-source-id: 964412d9d8daedfe265cf277f9fe5896856e47f8
  • Loading branch information
pedpess authored and M-i-k-e-l committed Mar 10, 2020
1 parent c1ebdf1 commit 38191cb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

'use strict';

const DatePickerModule = require('../../BatchedBridge/NativeModules')
.DatePickerAndroid;
import type {Options, DatePickerOpenAction} from './DatePickerAndroidTypes';
import NativeDatePickerAndroid from './NativeDatePickerAndroid';

/**
* Convert a Date to a timestamp.
Expand Down Expand Up @@ -74,7 +73,7 @@ class DatePickerAndroid {
_toMillis(optionsMs, 'minDate');
_toMillis(optionsMs, 'maxDate');
}
return DatePickerModule.open(options);
return NativeDatePickerAndroid.open(options);
}

/**
Expand Down
20 changes: 20 additions & 0 deletions Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/

'use strict';

import type {TurboModule} from 'RCTExport';
import * as TurboModuleRegistry from 'TurboModuleRegistry';

export interface Spec extends TurboModule {
+open: (options: Object) => Promise<Object>;
}

export default TurboModuleRegistry.getEnforcing<Spec>('DatePickerAndroid');

0 comments on commit 38191cb

Please sign in to comment.