Skip to content

Commit 34d88bc

Browse files
pedpessfacebook-github-bot
authored andcommitted
Add Spec for DatePickerAndroid (#24916)
Summary: This PR solves part of this issue: #24875 ## Changelog [General] [Added] - TM Spec for DatePickerAndroid Pull Request resolved: #24916 Reviewed By: RSNara Differential Revision: D15425864 Pulled By: fkgozali fbshipit-source-id: 964412d9d8daedfe265cf277f9fe5896856e47f8
1 parent 56c3852 commit 34d88bc

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010

1111
'use strict';
1212

13-
const DatePickerModule = require('../../BatchedBridge/NativeModules')
14-
.DatePickerAndroid;
1513
import type {Options, DatePickerOpenAction} from './DatePickerAndroidTypes';
14+
import NativeDatePickerAndroid from './NativeDatePickerAndroid';
1615

1716
/**
1817
* Convert a Date to a timestamp.
@@ -74,7 +73,7 @@ class DatePickerAndroid {
7473
_toMillis(optionsMs, 'minDate');
7574
_toMillis(optionsMs, 'maxDate');
7675
}
77-
return DatePickerModule.open(options);
76+
return NativeDatePickerAndroid.open(options);
7877
}
7978

8079
/**
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @flow
8+
* @format
9+
*/
10+
11+
'use strict';
12+
13+
import type {TurboModule} from 'RCTExport';
14+
import * as TurboModuleRegistry from 'TurboModuleRegistry';
15+
16+
export interface Spec extends TurboModule {
17+
+open: (options: Object) => Promise<Object>;
18+
}
19+
20+
export default TurboModuleRegistry.getEnforcing<Spec>('DatePickerAndroid');

0 commit comments

Comments
 (0)