* Android native module

* Call datepickerdialog show()

* refactor

* Wrap params

* Android native module

* Call datepickerdialog show()

* refactor

* Wrap params

* datetime

* date time calculations

* PR comments + refactor types

* Change files

* prettier fix

* import type fix
This commit is contained in:
Anindit K 2023-09-19 12:01:59 -07:00 коммит произвёл GitHub
Родитель 3fdf1ab56c
Коммит 426330058b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
24 изменённых файлов: 1138 добавлений и 288 удалений

Просмотреть файл

@ -1,18 +1,18 @@
PODS:
- boost (1.76.0)
- DoubleConversion (1.1.6)
- FBLazyVector (0.71.12)
- FBReactNativeSpec (0.71.12):
- FBLazyVector (0.71.13)
- FBReactNativeSpec (0.71.13):
- RCT-Folly (= 2021.07.22.00)
- RCTRequired (= 0.71.12)
- RCTTypeSafety (= 0.71.12)
- React-Core (= 0.71.12)
- React-jsi (= 0.71.12)
- ReactCommon/turbomodule/core (= 0.71.12)
- RCTRequired (= 0.71.13)
- RCTTypeSafety (= 0.71.13)
- React-Core (= 0.71.13)
- React-jsi (= 0.71.13)
- ReactCommon/turbomodule/core (= 0.71.13)
- fmt (6.2.1)
- FRNAppearanceAdditions (0.5.4):
- FRNAppearanceAdditions (0.5.8):
- React
- FRNAvatar (0.19.3):
- FRNAvatar (0.19.7):
- MicrosoftFluentUI (= 0.13.1)
- React
- FRNDatePicker (0.8.0):
@ -193,26 +193,26 @@ PODS:
- DoubleConversion
- fmt (~> 6.2.1)
- glog
- RCTRequired (0.71.12)
- RCTTypeSafety (0.71.12):
- FBLazyVector (= 0.71.12)
- RCTRequired (= 0.71.12)
- React-Core (= 0.71.12)
- React (0.71.12):
- React-Core (= 0.71.12)
- React-Core/DevSupport (= 0.71.12)
- React-Core/RCTWebSocket (= 0.71.12)
- React-RCTActionSheet (= 0.71.12)
- React-RCTAnimation (= 0.71.12)
- React-RCTBlob (= 0.71.12)
- React-RCTImage (= 0.71.12)
- React-RCTLinking (= 0.71.12)
- React-RCTNetwork (= 0.71.12)
- React-RCTSettings (= 0.71.12)
- React-RCTText (= 0.71.12)
- React-RCTVibration (= 0.71.12)
- React-callinvoker (0.71.12)
- React-Codegen (0.71.12):
- RCTRequired (0.71.13)
- RCTTypeSafety (0.71.13):
- FBLazyVector (= 0.71.13)
- RCTRequired (= 0.71.13)
- React-Core (= 0.71.13)
- React (0.71.13):
- React-Core (= 0.71.13)
- React-Core/DevSupport (= 0.71.13)
- React-Core/RCTWebSocket (= 0.71.13)
- React-RCTActionSheet (= 0.71.13)
- React-RCTAnimation (= 0.71.13)
- React-RCTBlob (= 0.71.13)
- React-RCTImage (= 0.71.13)
- React-RCTLinking (= 0.71.13)
- React-RCTNetwork (= 0.71.13)
- React-RCTSettings (= 0.71.13)
- React-RCTText (= 0.71.13)
- React-RCTVibration (= 0.71.13)
- React-callinvoker (0.71.13)
- React-Codegen (0.71.13):
- FBReactNativeSpec
- RCT-Folly
- RCTRequired
@ -223,283 +223,283 @@ PODS:
- React-jsiexecutor
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- React-Core (0.71.12):
- React-Core (0.71.13):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default (= 0.71.12)
- React-cxxreact (= 0.71.12)
- React-Core/Default (= 0.71.13)
- React-cxxreact (= 0.71.13)
- React-jsc
- React-jsi (= 0.71.12)
- React-jsiexecutor (= 0.71.12)
- React-perflogger (= 0.71.12)
- React-jsi (= 0.71.13)
- React-jsiexecutor (= 0.71.13)
- React-perflogger (= 0.71.13)
- Yoga
- React-Core/CoreModulesHeaders (0.71.12):
- React-Core/CoreModulesHeaders (0.71.13):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.12)
- React-cxxreact (= 0.71.13)
- React-jsc
- React-jsi (= 0.71.12)
- React-jsiexecutor (= 0.71.12)
- React-perflogger (= 0.71.12)
- React-jsi (= 0.71.13)
- React-jsiexecutor (= 0.71.13)
- React-perflogger (= 0.71.13)
- Yoga
- React-Core/Default (0.71.12):
- React-Core/Default (0.71.13):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-cxxreact (= 0.71.12)
- React-cxxreact (= 0.71.13)
- React-jsc
- React-jsi (= 0.71.12)
- React-jsiexecutor (= 0.71.12)
- React-perflogger (= 0.71.12)
- React-jsi (= 0.71.13)
- React-jsiexecutor (= 0.71.13)
- React-perflogger (= 0.71.13)
- Yoga
- React-Core/DevSupport (0.71.12):
- React-Core/DevSupport (0.71.13):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default (= 0.71.12)
- React-Core/RCTWebSocket (= 0.71.12)
- React-cxxreact (= 0.71.12)
- React-Core/Default (= 0.71.13)
- React-Core/RCTWebSocket (= 0.71.13)
- React-cxxreact (= 0.71.13)
- React-jsc
- React-jsi (= 0.71.12)
- React-jsiexecutor (= 0.71.12)
- React-jsinspector (= 0.71.12)
- React-perflogger (= 0.71.12)
- React-jsi (= 0.71.13)
- React-jsiexecutor (= 0.71.13)
- React-jsinspector (= 0.71.13)
- React-perflogger (= 0.71.13)
- Yoga
- React-Core/RCTActionSheetHeaders (0.71.12):
- React-Core/RCTActionSheetHeaders (0.71.13):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.12)
- React-cxxreact (= 0.71.13)
- React-jsc
- React-jsi (= 0.71.12)
- React-jsiexecutor (= 0.71.12)
- React-perflogger (= 0.71.12)
- React-jsi (= 0.71.13)
- React-jsiexecutor (= 0.71.13)
- React-perflogger (= 0.71.13)
- Yoga
- React-Core/RCTAnimationHeaders (0.71.12):
- React-Core/RCTAnimationHeaders (0.71.13):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.12)
- React-cxxreact (= 0.71.13)
- React-jsc
- React-jsi (= 0.71.12)
- React-jsiexecutor (= 0.71.12)
- React-perflogger (= 0.71.12)
- React-jsi (= 0.71.13)
- React-jsiexecutor (= 0.71.13)
- React-perflogger (= 0.71.13)
- Yoga
- React-Core/RCTBlobHeaders (0.71.12):
- React-Core/RCTBlobHeaders (0.71.13):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.12)
- React-cxxreact (= 0.71.13)
- React-jsc
- React-jsi (= 0.71.12)
- React-jsiexecutor (= 0.71.12)
- React-perflogger (= 0.71.12)
- React-jsi (= 0.71.13)
- React-jsiexecutor (= 0.71.13)
- React-perflogger (= 0.71.13)
- Yoga
- React-Core/RCTImageHeaders (0.71.12):
- React-Core/RCTImageHeaders (0.71.13):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.12)
- React-cxxreact (= 0.71.13)
- React-jsc
- React-jsi (= 0.71.12)
- React-jsiexecutor (= 0.71.12)
- React-perflogger (= 0.71.12)
- React-jsi (= 0.71.13)
- React-jsiexecutor (= 0.71.13)
- React-perflogger (= 0.71.13)
- Yoga
- React-Core/RCTLinkingHeaders (0.71.12):
- React-Core/RCTLinkingHeaders (0.71.13):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.12)
- React-cxxreact (= 0.71.13)
- React-jsc
- React-jsi (= 0.71.12)
- React-jsiexecutor (= 0.71.12)
- React-perflogger (= 0.71.12)
- React-jsi (= 0.71.13)
- React-jsiexecutor (= 0.71.13)
- React-perflogger (= 0.71.13)
- Yoga
- React-Core/RCTNetworkHeaders (0.71.12):
- React-Core/RCTNetworkHeaders (0.71.13):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.12)
- React-cxxreact (= 0.71.13)
- React-jsc
- React-jsi (= 0.71.12)
- React-jsiexecutor (= 0.71.12)
- React-perflogger (= 0.71.12)
- React-jsi (= 0.71.13)
- React-jsiexecutor (= 0.71.13)
- React-perflogger (= 0.71.13)
- Yoga
- React-Core/RCTSettingsHeaders (0.71.12):
- React-Core/RCTSettingsHeaders (0.71.13):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.12)
- React-cxxreact (= 0.71.13)
- React-jsc
- React-jsi (= 0.71.12)
- React-jsiexecutor (= 0.71.12)
- React-perflogger (= 0.71.12)
- React-jsi (= 0.71.13)
- React-jsiexecutor (= 0.71.13)
- React-perflogger (= 0.71.13)
- Yoga
- React-Core/RCTTextHeaders (0.71.12):
- React-Core/RCTTextHeaders (0.71.13):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.12)
- React-cxxreact (= 0.71.13)
- React-jsc
- React-jsi (= 0.71.12)
- React-jsiexecutor (= 0.71.12)
- React-perflogger (= 0.71.12)
- React-jsi (= 0.71.13)
- React-jsiexecutor (= 0.71.13)
- React-perflogger (= 0.71.13)
- Yoga
- React-Core/RCTVibrationHeaders (0.71.12):
- React-Core/RCTVibrationHeaders (0.71.13):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default
- React-cxxreact (= 0.71.12)
- React-cxxreact (= 0.71.13)
- React-jsc
- React-jsi (= 0.71.12)
- React-jsiexecutor (= 0.71.12)
- React-perflogger (= 0.71.12)
- React-jsi (= 0.71.13)
- React-jsiexecutor (= 0.71.13)
- React-perflogger (= 0.71.13)
- Yoga
- React-Core/RCTWebSocket (0.71.12):
- React-Core/RCTWebSocket (0.71.13):
- glog
- RCT-Folly (= 2021.07.22.00)
- React-Core/Default (= 0.71.12)
- React-cxxreact (= 0.71.12)
- React-Core/Default (= 0.71.13)
- React-cxxreact (= 0.71.13)
- React-jsc
- React-jsi (= 0.71.12)
- React-jsiexecutor (= 0.71.12)
- React-perflogger (= 0.71.12)
- React-jsi (= 0.71.13)
- React-jsiexecutor (= 0.71.13)
- React-perflogger (= 0.71.13)
- Yoga
- React-CoreModules (0.71.12):
- React-CoreModules (0.71.13):
- RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.71.12)
- React-Codegen (= 0.71.12)
- React-Core/CoreModulesHeaders (= 0.71.12)
- React-jsi (= 0.71.12)
- RCTTypeSafety (= 0.71.13)
- React-Codegen (= 0.71.13)
- React-Core/CoreModulesHeaders (= 0.71.13)
- React-jsi (= 0.71.13)
- React-RCTBlob
- React-RCTImage (= 0.71.12)
- ReactCommon/turbomodule/core (= 0.71.12)
- React-cxxreact (0.71.12):
- React-RCTImage (= 0.71.13)
- ReactCommon/turbomodule/core (= 0.71.13)
- React-cxxreact (0.71.13):
- boost (= 1.76.0)
- DoubleConversion
- glog
- RCT-Folly (= 2021.07.22.00)
- React-callinvoker (= 0.71.12)
- React-jsi (= 0.71.12)
- React-jsinspector (= 0.71.12)
- React-logger (= 0.71.12)
- React-perflogger (= 0.71.12)
- React-runtimeexecutor (= 0.71.12)
- React-jsc (0.71.12):
- React-jsc/Fabric (= 0.71.12)
- React-jsi (= 0.71.12)
- React-jsc/Fabric (0.71.12):
- React-jsi (= 0.71.12)
- React-jsi (0.71.12):
- React-callinvoker (= 0.71.13)
- React-jsi (= 0.71.13)
- React-jsinspector (= 0.71.13)
- React-logger (= 0.71.13)
- React-perflogger (= 0.71.13)
- React-runtimeexecutor (= 0.71.13)
- React-jsc (0.71.13):
- React-jsc/Fabric (= 0.71.13)
- React-jsi (= 0.71.13)
- React-jsc/Fabric (0.71.13):
- React-jsi (= 0.71.13)
- React-jsi (0.71.13):
- boost (= 1.76.0)
- DoubleConversion
- glog
- RCT-Folly (= 2021.07.22.00)
- React-jsiexecutor (0.71.12):
- React-jsiexecutor (0.71.13):
- DoubleConversion
- glog
- RCT-Folly (= 2021.07.22.00)
- React-cxxreact (= 0.71.12)
- React-jsi (= 0.71.12)
- React-perflogger (= 0.71.12)
- React-jsinspector (0.71.12)
- React-logger (0.71.12):
- React-cxxreact (= 0.71.13)
- React-jsi (= 0.71.13)
- React-perflogger (= 0.71.13)
- React-jsinspector (0.71.13)
- React-logger (0.71.13):
- glog
- react-native-menu (0.7.3):
- React
- react-native-slider (4.4.2):
- react-native-slider (4.4.3):
- React-Core
- React-perflogger (0.71.12)
- React-RCTActionSheet (0.71.12):
- React-Core/RCTActionSheetHeaders (= 0.71.12)
- React-RCTAnimation (0.71.12):
- React-perflogger (0.71.13)
- React-RCTActionSheet (0.71.13):
- React-Core/RCTActionSheetHeaders (= 0.71.13)
- React-RCTAnimation (0.71.13):
- RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.71.12)
- React-Codegen (= 0.71.12)
- React-Core/RCTAnimationHeaders (= 0.71.12)
- React-jsi (= 0.71.12)
- ReactCommon/turbomodule/core (= 0.71.12)
- React-RCTAppDelegate (0.71.12):
- RCTTypeSafety (= 0.71.13)
- React-Codegen (= 0.71.13)
- React-Core/RCTAnimationHeaders (= 0.71.13)
- React-jsi (= 0.71.13)
- ReactCommon/turbomodule/core (= 0.71.13)
- React-RCTAppDelegate (0.71.13):
- RCT-Folly
- RCTRequired
- RCTTypeSafety
- React-Core
- ReactCommon/turbomodule/core
- React-RCTBlob (0.71.12):
- React-RCTBlob (0.71.13):
- RCT-Folly (= 2021.07.22.00)
- React-Codegen (= 0.71.12)
- React-Core/RCTBlobHeaders (= 0.71.12)
- React-Core/RCTWebSocket (= 0.71.12)
- React-jsi (= 0.71.12)
- React-RCTNetwork (= 0.71.12)
- ReactCommon/turbomodule/core (= 0.71.12)
- React-RCTImage (0.71.12):
- React-Codegen (= 0.71.13)
- React-Core/RCTBlobHeaders (= 0.71.13)
- React-Core/RCTWebSocket (= 0.71.13)
- React-jsi (= 0.71.13)
- React-RCTNetwork (= 0.71.13)
- ReactCommon/turbomodule/core (= 0.71.13)
- React-RCTImage (0.71.13):
- RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.71.12)
- React-Codegen (= 0.71.12)
- React-Core/RCTImageHeaders (= 0.71.12)
- React-jsi (= 0.71.12)
- React-RCTNetwork (= 0.71.12)
- ReactCommon/turbomodule/core (= 0.71.12)
- React-RCTLinking (0.71.12):
- React-Codegen (= 0.71.12)
- React-Core/RCTLinkingHeaders (= 0.71.12)
- React-jsi (= 0.71.12)
- ReactCommon/turbomodule/core (= 0.71.12)
- React-RCTNetwork (0.71.12):
- RCTTypeSafety (= 0.71.13)
- React-Codegen (= 0.71.13)
- React-Core/RCTImageHeaders (= 0.71.13)
- React-jsi (= 0.71.13)
- React-RCTNetwork (= 0.71.13)
- ReactCommon/turbomodule/core (= 0.71.13)
- React-RCTLinking (0.71.13):
- React-Codegen (= 0.71.13)
- React-Core/RCTLinkingHeaders (= 0.71.13)
- React-jsi (= 0.71.13)
- ReactCommon/turbomodule/core (= 0.71.13)
- React-RCTNetwork (0.71.13):
- RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.71.12)
- React-Codegen (= 0.71.12)
- React-Core/RCTNetworkHeaders (= 0.71.12)
- React-jsi (= 0.71.12)
- ReactCommon/turbomodule/core (= 0.71.12)
- React-RCTSettings (0.71.12):
- RCTTypeSafety (= 0.71.13)
- React-Codegen (= 0.71.13)
- React-Core/RCTNetworkHeaders (= 0.71.13)
- React-jsi (= 0.71.13)
- ReactCommon/turbomodule/core (= 0.71.13)
- React-RCTSettings (0.71.13):
- RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.71.12)
- React-Codegen (= 0.71.12)
- React-Core/RCTSettingsHeaders (= 0.71.12)
- React-jsi (= 0.71.12)
- ReactCommon/turbomodule/core (= 0.71.12)
- React-RCTText (0.71.12):
- React-Core/RCTTextHeaders (= 0.71.12)
- React-RCTVibration (0.71.12):
- RCTTypeSafety (= 0.71.13)
- React-Codegen (= 0.71.13)
- React-Core/RCTSettingsHeaders (= 0.71.13)
- React-jsi (= 0.71.13)
- ReactCommon/turbomodule/core (= 0.71.13)
- React-RCTText (0.71.13):
- React-Core/RCTTextHeaders (= 0.71.13)
- React-RCTVibration (0.71.13):
- RCT-Folly (= 2021.07.22.00)
- React-Codegen (= 0.71.12)
- React-Core/RCTVibrationHeaders (= 0.71.12)
- React-jsi (= 0.71.12)
- ReactCommon/turbomodule/core (= 0.71.12)
- React-runtimeexecutor (0.71.12):
- React-jsi (= 0.71.12)
- ReactCommon/turbomodule/bridging (0.71.12):
- React-Codegen (= 0.71.13)
- React-Core/RCTVibrationHeaders (= 0.71.13)
- React-jsi (= 0.71.13)
- ReactCommon/turbomodule/core (= 0.71.13)
- React-runtimeexecutor (0.71.13):
- React-jsi (= 0.71.13)
- ReactCommon/turbomodule/bridging (0.71.13):
- DoubleConversion
- glog
- RCT-Folly (= 2021.07.22.00)
- React-callinvoker (= 0.71.12)
- React-Core (= 0.71.12)
- React-cxxreact (= 0.71.12)
- React-jsi (= 0.71.12)
- React-logger (= 0.71.12)
- React-perflogger (= 0.71.12)
- ReactCommon/turbomodule/core (0.71.12):
- React-callinvoker (= 0.71.13)
- React-Core (= 0.71.13)
- React-cxxreact (= 0.71.13)
- React-jsi (= 0.71.13)
- React-logger (= 0.71.13)
- React-perflogger (= 0.71.13)
- ReactCommon/turbomodule/core (0.71.13):
- DoubleConversion
- glog
- RCT-Folly (= 2021.07.22.00)
- React-callinvoker (= 0.71.12)
- React-Core (= 0.71.12)
- React-cxxreact (= 0.71.12)
- React-jsi (= 0.71.12)
- React-logger (= 0.71.12)
- React-perflogger (= 0.71.12)
- ReactNativeHost (0.2.7):
- React-callinvoker (= 0.71.13)
- React-Core (= 0.71.13)
- React-cxxreact (= 0.71.13)
- React-jsi (= 0.71.13)
- React-logger (= 0.71.13)
- React-perflogger (= 0.71.13)
- ReactNativeHost (0.2.8):
- React-Core
- React-cxxreact
- ReactCommon/turbomodule/core
- ReactTestApp-DevSupport (2.5.12):
- ReactTestApp-DevSupport (2.5.16):
- React-Core
- React-jsi
- ReactTestApp-Resources (1.0.0-dev)
- RNCPicker (2.4.10):
- RNCPicker (2.5.0):
- React-Core
- RNSVG (13.10.0):
- RNSVG (13.13.0):
- React-Core
- Yoga (1.14.0)
@ -648,50 +648,50 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
boost: 57d2868c099736d80fcd648bf211b4431e51a558
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
FBLazyVector: 4eb7ee83e8d0ad7e20a829485295ff48823c4e4c
FBReactNativeSpec: c64c99884d25e07301aaf0d243d83bb2c100880f
FBLazyVector: 24e08bf294faea0abc0278abb2fcad7f3e446f6f
FBReactNativeSpec: 97eaa25254d8ce30b17f5a28c32664890819af35
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
FRNAppearanceAdditions: 5b8fa16ad65830031acd4d2f160539c9b0721c33
FRNAvatar: 65790bfa0ebdbba2c7b0f29efa3728b7769e9c65
FRNAppearanceAdditions: ae112fef1bf92d0282c66b53eac14c1de22c97d2
FRNAvatar: 1db3235b5e4320685b7bc5e69f507632189b0f82
FRNDatePicker: 78b02a5ba9d7559d553b358271b1ec18ebecb1ec
FRNFontMetrics: 41579c8c7cef1f816a894b6d3968461ef599f5c1
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
MicrosoftFluentUI: dde98d8ed3fc306d9ddd0a6f0bc0c1f24fe5275e
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: 4db5e3e18b906377a502da5b358ff159ba4783ed
RCTTypeSafety: 6c1a8aed043050de0d537336c95cd1be7b66c272
React: 214e77358d860a3ed707fede9088e7c00663a087
React-callinvoker: 8fc1c79c26fbcadce2a5d4a3cb4b2ced2dec3436
React-Codegen: b2ac76583168cf823ceefa092ab05bdfb032b390
React-Core: 71a65c31e05897700e42f5356f29fe485c334e6d
React-CoreModules: d9680e1d551eef1dd764df736a473cf25f701070
React-cxxreact: bb84a3ef29ed59211987a34897704b9c56d1b765
React-jsc: 442c396c8180dc25c390ee23a3536d8c600718be
React-jsi: 2a87379ac68034e1a5d2a9c796486aea6bdca3ef
React-jsiexecutor: a78a0e415dc4b786a4308becf3e3bc6dbbc7b92e
React-jsinspector: ec4dcbfb1f4e72f04f826a0301eceee5fa7ca540
React-logger: 35538accacf2583693fbc3ee8b53e69a1776fcee
RCTRequired: c20235648eeb64a874f55459ceae6b081956318d
RCTTypeSafety: ca004f1fe0b76f7936f7fe7dfd761a4386cf72f5
React: b27df2b1da30335cf1bf1909056c4e1c3a3603ae
React-callinvoker: f2a69510d781d8226d51342a3cbe8a9b13573ea5
React-Codegen: fc3a9885cb4d341b87dc28627dc55d21abc89788
React-Core: ba3402af336f345b2178d97be2dd5d8d70f8f068
React-CoreModules: 0e081b26ab034992d6a60217fc35a83e8ad9b8ed
React-cxxreact: 65b6f835fb2654a8c2011412bad4f8a2f4d1ccca
React-jsc: 61eedc91c322c4d393cf8369a059902de301f2c9
React-jsi: a05a2aab770ba542966849e45f330bc366ad8905
React-jsiexecutor: 619be858f64120a6b9c1b36c1e8c538b55872e23
React-jsinspector: 7e58fe86c7cc442fd11da0c9d8bef12a8d63f771
React-logger: a3f6ca0d018749852a2a6f07c154bfc6fcd4195a
react-native-menu: 9d7d6f819cc7fa14a15cf86888c53f3240d86f1b
react-native-slider: 33b8d190b59d4f67a541061bb91775d53d617d9d
React-perflogger: 75b0e25075c67565a830985f3c373e2eae5389e0
React-RCTActionSheet: a0c3e916b327e297d124d9ebe8b0c721840ee04d
React-RCTAnimation: 3da7025801d7bf0f8cfd94574d6278d5b82a8b88
React-RCTAppDelegate: 851be18dd9ed11f85568f2357581632ca323efe9
React-RCTBlob: fa3ba422e3ea4520f9d726b0327b9b9e96dc46d4
React-RCTImage: e230761bd34d71362dd8b3d51b5cd72674935aa0
React-RCTLinking: 3294b1b540005628168e5a341963b0eddc3932e8
React-RCTNetwork: 00c6b2215e54a9fb015c53a5e02b0a852dbb8568
React-RCTSettings: 2e7e4964f45e9b24c6c32ad30b6ab2ef4a7e2ffc
React-RCTText: a9c712b13cab90e1432e0ad113edc8bdbc691248
React-RCTVibration: a283fefb8cc29d9740a7ff2e87f72ad10f25a433
React-runtimeexecutor: 7902246857a4ead4166869e6c42d4df329ff721d
ReactCommon: 903ae47d52e4af9bd1d41d5c7c6004e828aa59a1
ReactNativeHost: 5dd0021c01ade845f1171f4e6f6814f214ddfadb
ReactTestApp-DevSupport: 7c030a9b1a9d54ba3f39db6ea9af7e7d02acd387
react-native-slider: 1cdd6ba29675df21f30544253bf7351d3c2d68c4
React-perflogger: 431a655960a02f01257d631b2a9bfbb02fd21064
React-RCTActionSheet: 38c8d496d0faa63013d16f709e10a3acf6b5f100
React-RCTAnimation: 6da4d599f3262ed8021433ddd96de45ac9e731b1
React-RCTAppDelegate: 3053338f2a9ebbaccb3828b3d471250a7e7b878c
React-RCTBlob: 54afdbd19710a6d0be0c28b64a4a0db625bc2a30
React-RCTImage: 4e31e6ebf2b9705831d1855425a043b40eec1f61
React-RCTLinking: 22ac16d44e2df03e9ca9125273fc58a7c507f529
React-RCTNetwork: 4bacd206834633c23475485dbc21c18563627af4
React-RCTSettings: 4e4ace986ae92a7e1696fdac11615576b698f337
React-RCTText: 37a1341bdf1f80e9909f6b69a7a9ee747cb682d3
React-RCTVibration: 2271362cdf9ff2dae6a2156f5101e5c30b02694d
React-runtimeexecutor: 35cec6420c9d4144b0d06f9fdb093cf8f02bd52c
ReactCommon: 56296d2632e8eb53e94a2b7c0d05db694e164ca7
ReactNativeHost: 5caf8c9381f26c453fabbe8c3b87f6a013a3c459
ReactTestApp-DevSupport: 444613e05eef80e5d2ecb5302e44b9a7abc597fa
ReactTestApp-Resources: 3a5202e2bbbd3fb589d54d15f296a52a5659855f
RNCPicker: 0bc2f0a29abcca7b7ed44a2d036aac9ab6d25700
RNSVG: 80584470ff1ffc7994923ea135a3e5ad825546b9
Yoga: 39310a10944fc864a7550700de349183450f8aaa
RNCPicker: 32ca102146bc7d34a8b93a998d9938d9f9ec7898
RNSVG: ed492aaf3af9ca01bc945f7a149d76d62e73ec82
Yoga: 135109c9b8c5d1a8af3a58d21cd4c7aa7f3bf555
PODFILE CHECKSUM: b9fd154312c68d8d92a9ba6e8a2cac9fcf88b104

Просмотреть файл

@ -1,5 +1,5 @@
import * as React from 'react';
import { Switch, View } from 'react-native';
import { Platform, Switch, View } from 'react-native';
import { Text } from '@fluentui/react-native';
import { Button } from '@fluentui-react-native/button';
@ -11,7 +11,114 @@ import { stackStyle, commonTestStyles as commonStyles } from '../Common/styles';
import type { PlatformStatus, TestSection } from '../Test';
import { Test } from '../Test';
const NativeDatePickerMainTest: React.FunctionComponent = () => {
const NativeDatePickerAndroidUsage: React.FunctionComponent = () => {
const today = new Date();
const [startDate, setStartDate] = React.useState<Date>(today);
const [endDate, setEndDate] = React.useState<Date>(today);
return (
<Stack style={stackStyle}>
<Text variant="headerStandard">Selected Start Date/Time</Text>
<Text variant="subheaderStandard">
{startDate?.toString()} {'\n'}
</Text>
<Text variant="headerStandard">Selected End Date/Time</Text>
<Text variant="subheaderStandard">
{endDate?.toString() ?? 'N/A'} {'\n'}
</Text>
<Button
content="Date Picker"
onClick={() => {
NativeDatePicker.present({
mode: 'date',
startDate: startDate,
endDate: endDate,
callback: (date1: string, date2: string) => {
console.warn(`${date1} - ${date2}`);
setStartDate(NativeDatePicker.parseISOString(date1));
},
});
}}
/>
<Text variant="headerStandard">Ranged Datepicker</Text>
<View style={{ flexDirection: 'row' }}>
<Button
content="Start Date"
onClick={() => {
NativeDatePicker.present({
mode: 'dateRange',
dateRangeMode: 'start',
startDate: startDate,
endDate: endDate,
callback: (date1: string, date2: string) => {
console.warn(`${date1} - ${date2}`);
setStartDate(NativeDatePicker.parseISOString(date1));
setEndDate(NativeDatePicker.parseISOString(date2));
},
});
}}
/>
<Button
content="End Date"
onClick={() => {
NativeDatePicker.present({
mode: 'dateRange',
dateRangeMode: 'end',
startDate: startDate,
endDate: endDate,
callback: (date1: string, date2: string) => {
console.warn(`${date1} - ${date2}`);
setStartDate(NativeDatePicker.parseISOString(date1));
setEndDate(NativeDatePicker.parseISOString(date2));
},
});
}}
/>
</View>
<Text variant="headerStandard">Date and Time</Text>
<Button
content="Date Time Picker"
onClick={() => {
NativeDatePicker.present({
mode: 'dateTime',
startDate: startDate,
endDate: endDate,
callback: (date1: string, date2: string) => {
console.warn(`${date1} - ${date2}`);
setStartDate(NativeDatePicker.parseISOString(date1));
},
});
}}
/>
<Text variant="headerStandard">Ranged Date Time Picker</Text>
<View style={{ flexDirection: 'row' }}>
<Button
content="Date Time Range"
onClick={() => {
NativeDatePicker.present({
mode: 'dateTimeRange',
dateRangeMode: 'start',
startDate: startDate,
endDate: endDate,
callback: (date1: string, date2: string) => {
console.warn(`${date1} - ${date2}`);
setStartDate(NativeDatePicker.parseISOString(date1));
setEndDate(NativeDatePicker.parseISOString(date2));
},
});
}}
/>
</View>
</Stack>
);
};
const NativeDatePickeriOSUsage: React.FunctionComponent = () => {
const [startDate, setStartDate] = React.useState<Date>(new Date());
const [endDate, setEndDate] = React.useState<Date>(null);
const [customCalendarConfiguration, setCustomCalendarConfiguration] = React.useState(false);
@ -230,11 +337,21 @@ const NativeDatePickerMainTest: React.FunctionComponent = () => {
};
const nativeDatePickerSections: TestSection[] = [
{
name: 'Native Date Picker',
testID: NATIVEDATEPICKER_TESTPAGE,
component: NativeDatePickerMainTest,
},
...Platform.select({
android: [
{
name: 'Native Date Picker',
component: NativeDatePickerAndroidUsage,
},
],
default: [
{
name: 'Native Date Picker',
testID: NATIVEDATEPICKER_TESTPAGE,
component: NativeDatePickeriOSUsage,
},
],
}),
];
export const NativeDatePickerTest: React.FunctionComponent = () => {
@ -243,10 +360,10 @@ export const NativeDatePickerTest: React.FunctionComponent = () => {
uwpStatus: 'N/A',
iosStatus: 'Experimental',
macosStatus: 'N/A',
androidStatus: 'N/A',
androidStatus: 'Experimental',
};
const description = 'A Native date picker component using the Fluent Design System. Currently only implemented on iOS.';
const description = 'A Native date picker component using the Fluent Design System.';
return <Test name="Native Date Picker Test" description={description} sections={nativeDatePickerSections} status={status}></Test>;
};

Просмотреть файл

@ -124,7 +124,7 @@ export const tests: TestDescription[] = [
name: 'Date Picker (Native)',
component: NativeDatePickerTest,
testPageButton: HOMEPAGE_NATIVEDATEPICKER_BUTTON,
platforms: ['ios'],
platforms: ['ios', 'android'],
},
{
name: 'Divider',

Просмотреть файл

@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Android native date picker",
"packageName": "@fluentui-react-native/experimental-native-date-picker",
"email": "ankarm@microsoft.com",
"dependentChangeType": "patch"
}

Просмотреть файл

@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Android native date picker",
"packageName": "@fluentui-react-native/tester",
"email": "ankarm@microsoft.com",
"dependentChangeType": "patch"
}

9
packages/experimental/NativeDatePicker/android/.gitattributes поставляемый Normal file
Просмотреть файл

@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf
# These are Windows script files and should use crlf
*.bat text eol=crlf

33
packages/experimental/NativeDatePicker/android/.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,33 @@
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Log/OS Files
*.log
# Android Studio generated files and folders
captures/
.externalNativeBuild/
.cxx/
*.apk
output.json
# IntelliJ
*.iml
.idea/
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml
# Keystore files
*.jks
*.keystore
# Google Services (e.g. APIs or Firebase)
google-services.json
# Android Profiling
*.hprof

Просмотреть файл

@ -0,0 +1,48 @@
buildscript {
ext.safeExtGet = { prop, fallback ->
return rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
repositories {
mavenCentral()
google()
}
dependencies {
classpath "com.android.tools.build:gradle"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.6.10')}"
classpath "com.facebook.react:react-native-gradle-plugin"
}
}
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
compileSdkVersion safeExtGet('compileSdkVersion', 31)
buildToolsVersion safeExtGet('buildToolsVersion', '31.0.0')
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 21)
targetSdkVersion safeExtGet('targetSdkVersion', 31)
}
}
repositories {
maven {
url "https://pkgs.dev.azure.com/MicrosoftDeviceSDK/DuoSDK-Public/_packaging/Duo-SDK-Feed/maven/v1"
}
mavenCentral()
google()
}
dependencies {
implementation "com.facebook.react:react-android:+"
implementation "com.microsoft.device:dualscreen-layout:1.0.0-alpha01"
implementation "com.microsoft.fluentui:fluentui_calendar:${safeExtGet('fluentUICalendarVersion', '0.0.27')}"
implementation "com.jakewharton.threetenabp:threetenabp:1.1.0"
}

Просмотреть файл

@ -0,0 +1 @@
android.useAndroidX=true

Двоичные данные
packages/experimental/NativeDatePicker/android/gradle/wrapper/gradle-wrapper.jar поставляемый Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

240
packages/experimental/NativeDatePicker/android/gradlew поставляемый Normal file
Просмотреть файл

@ -0,0 +1,240 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

91
packages/experimental/NativeDatePicker/android/gradlew.bat поставляемый Normal file
Просмотреть файл

@ -0,0 +1,91 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

Просмотреть файл

@ -0,0 +1,2 @@
includeBuild('../../../../node_modules/react-native-gradle-plugin')
rootProject.name = 'frndatepicker'

Просмотреть файл

@ -0,0 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.microsoft.fnandroid.frndatepicker"></manifest>

Просмотреть файл

@ -0,0 +1,186 @@
package com.microsoft.fnandroid.frndatepicker
import android.app.Activity
import android.os.Handler
import android.util.Log
import com.facebook.react.bridge.Callback
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
import com.jakewharton.threetenabp.AndroidThreeTen
import com.microsoft.fluentui.datetimepicker.DateTimePickerDialog
import org.threeten.bp.Duration
import org.threeten.bp.Instant
import org.threeten.bp.ZoneId
import org.threeten.bp.ZoneOffset
import org.threeten.bp.ZonedDateTime
import org.threeten.bp.format.DateTimeFormatter
class FRNDatePickerModule(private val reactContext: ReactApplicationContext) :
ReactContextBaseJavaModule(reactContext) {
override fun getName() = REACT_CLASS
override fun getConstants(): MutableMap<String, Any>? {
return hashMapOf("DIALOG_MODE" to hashMapOf<String, Int>(
"DATE" to DateTimePickerDialog.Mode.DATE.ordinal,
"DATE_TIME" to DateTimePickerDialog.Mode.DATE_TIME.ordinal,
"TIME_DATE" to DateTimePickerDialog.Mode.TIME_DATE.ordinal
), "DATE_RANGE_MODE" to hashMapOf<String, Int>(
"NONE" to DateTimePickerDialog.DateRangeMode.NONE.ordinal,
"START" to DateTimePickerDialog.DateRangeMode.START.ordinal,
"END" to DateTimePickerDialog.DateRangeMode.END.ordinal,
))
}
companion object {
const val REACT_CLASS = "FRNDatePicker"
}
init {
AndroidThreeTen.init(reactContext);
}
@ReactMethod()
fun showDatePicker(
dialogMode: Int?,
dateRangeMode: Int?,
startDate: String?,
endDate: String?,
onDateTimePicked: Callback
) {
val dialogMode = dialogMode ?: DateTimePickerDialog.Mode.DATE.ordinal;
val dateRangeMode = dateRangeMode ?: DateTimePickerDialog.DateRangeMode.NONE.ordinal;
val mainHandler: Handler = Handler(reactContext.mainLooper)
val runnable = Runnable {
val dateTimePickerDialog = DateTimePickerDialog(
reactContext.currentActivity ?: reactContext,
DateTimePickerDialog.Mode.values()[dialogMode],
DateTimePickerDialog.DateRangeMode.values()[dateRangeMode],
getLocalZonedDateTimeFromString(startDate),
getDuration(startDate, endDate, DateTimePickerDialog.DateRangeMode.values()[dateRangeMode])
)
dateTimePickerDialog.onDateTimePickedListener =
object : DateTimePickerDialog.OnDateTimePickedListener {
override fun onDateTimePicked(pickedDateTime: ZonedDateTime, duration: Duration) {
var endDateTime: ZonedDateTime;
var startDateTime: ZonedDateTime;
when (dateRangeMode) {
DateTimePickerDialog.DateRangeMode.START.ordinal,
DateTimePickerDialog.DateRangeMode.END.ordinal
-> {
startDateTime = pickedDateTime;
endDateTime = pickedDateTime.plus(duration);
}
else -> {
startDateTime = pickedDateTime;
endDateTime = pickedDateTime;
}
}
onDateTimePicked.invoke(
formatDate(startDateTime,
DateTimePickerDialog.Mode.values()[dialogMode]),
formatDate(endDateTime,
DateTimePickerDialog.Mode.values()[dialogMode]))
}
}
dateTimePickerDialog.show();
}
mainHandler.post(runnable);
}
private fun formatDate(selectedDate: ZonedDateTime, dialogMode: DateTimePickerDialog.Mode): String {
val year = selectedDate.year;
val month = selectedDate.month.value;
val day = selectedDate.dayOfMonth;
val hour = selectedDate.hour;
val minute = selectedDate.minute;
val second = selectedDate.second;
val nano = selectedDate.nano;
val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
if (dialogMode == DateTimePickerDialog.Mode.DATE) {
val localDate = ZonedDateTime.of(
year,
month,
day,
0,
0,
0,
0,
ZoneId.systemDefault());
return formatter.format(localDate.withZoneSameInstant(ZoneOffset.UTC));
}
return formatter.format(selectedDate.withZoneSameInstant(ZoneOffset.UTC));
}
private fun getDuration(startDate: String?, endDate: String?, dateRangeMode: DateTimePickerDialog.DateRangeMode): Duration {
if (startDate.isNullOrBlank()
|| endDate.isNullOrBlank()
|| dateRangeMode == DateTimePickerDialog.DateRangeMode.NONE) {
return Duration.ZERO;
}
val zonedStart = getLocalZonedDateTimeFromString(startDate);
var zonedEnd = getLocalZonedDateTimeFromString(endDate);
if (zonedEnd < zonedStart) {
zonedEnd = zonedStart.plusDays(1)
}
val duration = Duration.between(zonedStart, zonedEnd);
return duration;
}
private fun getLocalZonedDateTimeFromString(dateTimeString: String?) : ZonedDateTime {
if (dateTimeString.isNullOrBlank()) {
return ZonedDateTime.now();
}
// expects 'dateTimeString' to be of the format yyyy-MM-ddTHH:mm:ss.SSSZ
val zonedDateTime: ZonedDateTime = ZonedDateTime.parse(dateTimeString);
val localDateTime = zonedDateTime.withZoneSameInstant(ZoneId.systemDefault());
val year = localDateTime.year;
val month = localDateTime.month.value;
val day = localDateTime.dayOfMonth;
val hour = localDateTime.hour;
val minute = localDateTime.minute;
val second = localDateTime.second;
val nano = localDateTime.nano;
val utcDate = ZonedDateTime.of(
year,
month,
day,
hour,
minute,
second,
nano,
ZoneOffset.UTC);
return utcDate;
}
private fun getZonedDateTimeFromString(dateTimeString: String?) : ZonedDateTime {
if (dateTimeString.isNullOrBlank()) {
return ZonedDateTime.now();
}
val formatter = DateTimeFormatter.ISO_INSTANT;
val instant = Instant.from(formatter.parse(dateTimeString));
val zonedDateTime = ZonedDateTime.ofInstant(instant, ZoneOffset.UTC);
return zonedDateTime;
}
private fun Log(msg: String) {
Log.d("FRNDatePickerModule", msg);
}
}

Просмотреть файл

@ -0,0 +1,18 @@
package com.microsoft.fnandroid.frndatepicker
import android.view.View
import com.facebook.react.ReactPackage
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ReactShadowNode
import com.facebook.react.uimanager.ViewManager
class FRNDatePickerPackage : ReactPackage {
override fun createViewManagers(
reactContext: ReactApplicationContext
): MutableList<ViewManager<View, ReactShadowNode<*>>> = mutableListOf()
override fun createNativeModules(
reactContext: ReactApplicationContext
): MutableList<NativeModule> = listOf(FRNDatePickerModule(reactContext)).toMutableList()
}

Просмотреть файл

@ -0,0 +1,9 @@
export const parseISOString = (dateISOString: string): Date => {
if (dateISOString == null) {
return null;
}
const dateParts: number[] = dateISOString.split(/\D+/).map((x) => parseInt(x, 10));
dateParts[1]--; // Date.UTC's `month` arg is zero-based
const dateUTC = Date.UTC.apply(null, dateParts);
return new Date(dateUTC);
};

Просмотреть файл

@ -0,0 +1,65 @@
import { NativeModules } from 'react-native';
import { parseISOString } from './DatePickerUtils';
import type { DatePickerNativeParameters, NativeDatePickerInterface } from './NativeDatePicker.types.mobile';
const FRNDatePicker = NativeModules.FRNDatePicker;
const { DIALOG_MODE, DATE_RANGE_MODE } = FRNDatePicker.getConstants();
type FRNDatePickerParams = {
dialogMode: number;
dateRangeMode: number;
startDate: string;
endDate: string;
callback: (startDate: string, endDate: string) => void;
};
const buildNativeParams = (params: DatePickerNativeParameters): FRNDatePickerParams => {
const nowDate = new Date();
let dialogMode = DIALOG_MODE.DATE;
let dateRangeMode = DATE_RANGE_MODE.NONE;
switch (params.mode) {
case 'date': {
// do nothing here. Keep defaults above.
break;
}
case 'dateRange': {
dateRangeMode = !params.dateRangeMode ? DATE_RANGE_MODE.NONE : DATE_RANGE_MODE[params.dateRangeMode.toUpperCase()];
break;
}
case 'dateTime': {
dialogMode = DIALOG_MODE.DATE_TIME;
break;
}
case 'dateTimeRange': {
dialogMode = DIALOG_MODE.DATE_TIME;
dateRangeMode = DATE_RANGE_MODE.START;
break;
}
}
return {
dialogMode,
dateRangeMode,
startDate: !params.startDate ? nowDate.toISOString() : params.startDate.toISOString(),
endDate: !params.endDate ? nowDate.toISOString() : params.endDate.toISOString(),
callback: params.callback,
};
};
export const NativeDatePicker: NativeDatePickerInterface = {
present: (params: DatePickerNativeParameters) => {
const frnDatePickerParams = buildNativeParams(params);
FRNDatePicker.showDatePicker(
frnDatePickerParams.dialogMode,
frnDatePickerParams.dateRangeMode,
frnDatePickerParams.startDate,
frnDatePickerParams.endDate,
frnDatePickerParams.callback,
);
},
parseISOString: (dateString: string) => {
return parseISOString(dateString);
},
};

Просмотреть файл

@ -1,34 +1,8 @@
import { NativeModules } from 'react-native';
export const NativeDatePicker = NativeModules.FRNDatePickerManager;
export const { MSFDateTimePickerMode, MSFDateTimePickerDatePickerType, MSFDateTimePickerDateRangePresentation } =
NativeDatePicker.getConstants();
// Enums from the iOS DateTimePicker in FluentUI-Apple
type NativeDatePickerMode = keyof typeof MSFDateTimePickerMode;
type NativeDatePickerType = keyof typeof MSFDateTimePickerDatePickerType;
type NativeDatePickerDateRangePresentation = keyof typeof MSFDateTimePickerDateRangePresentation;
interface DatePickerParameterObject {
mode?: NativeDatePickerMode;
dateRangePresentation?: NativeDatePickerDateRangePresentation;
datePickerType?: NativeDatePickerType;
startDate?: Date;
endDate?: Date;
referenceStartDate?: Date;
referenceEndDate?: Date;
startTitle?: string;
startSubtitle?: string;
startTab?: string;
endTitle?: string;
endSubtitle?: string;
endTab?: string;
dateTitle?: string;
dateSubtitle?: string;
timeTitle?: string;
timeSubtitle?: string;
// eslint-disable-next-line @typescript-eslint/ban-types
callback: Function;
}
import { parseISOString } from './DatePickerUtils';
import type { DatePickerNativeParameters, NativeDatePickerInterface } from './NativeDatePicker.types.mobile';
NativeDatePicker.present = ({
mode = 'date',
@ -49,7 +23,7 @@ NativeDatePicker.present = ({
timeTitle = null,
timeSubtitle = null,
callback,
}: DatePickerParameterObject) => {
}: DatePickerNativeParameters) => {
NativeDatePicker.presentWithMode(
mode,
dateRangePresentation,
@ -75,18 +49,7 @@ NativeDatePicker.present = ({
// We get date values back from the native side as strings in ISO 8601 format and UTC.
// We want to immediately put them back into `Date` objects in local time.
NativeDatePicker.parseISOString = (dateISOString: string): Date => {
if (dateISOString == null) {
return null;
}
const dateParts: number[] = dateISOString.split(/\D+/).map((x) => parseInt(x, 10));
dateParts[1]--; // Date.UTC's `month` arg is zero-based
const dateUTC = Date.UTC.apply(null, dateParts);
return new Date(dateUTC);
return parseISOString(dateISOString);
};
interface NativeDatePickerInterface {
present(object: DatePickerParameterObject): void;
parseISOString(dateISOString: string): Date;
}
export default NativeDatePicker as NativeDatePickerInterface;

Просмотреть файл

@ -1,2 +1,4 @@
export const NativeDatePicker = null;
import type { NativeDatePickerInterface } from './NativeDatePicker.types.mobile';
export const NativeDatePicker = null as NativeDatePickerInterface;
console.warn('DatePicker not supported');

Просмотреть файл

@ -0,0 +1,3 @@
export type DatePickerNativeAndroidParameters = {
dateRangeMode?: 'none' | 'start' | 'end';
};

Просмотреть файл

@ -0,0 +1,25 @@
import { NativeModules } from 'react-native';
export const NativeDatePicker = NativeModules.FRNDatePickerManager;
export const { MSFDateTimePickerMode, MSFDateTimePickerDatePickerType, MSFDateTimePickerDateRangePresentation } =
NativeDatePicker.getConstants();
// Enums from the iOS DateTimePicker in FluentUI-Apple
type NativeDatePickerType = keyof typeof MSFDateTimePickerDatePickerType;
type NativeDatePickerDateRangePresentation = keyof typeof MSFDateTimePickerDateRangePresentation;
export type DatePickerNativeIOSParameters = {
dateRangePresentation?: NativeDatePickerDateRangePresentation;
datePickerType?: NativeDatePickerType;
referenceStartDate?: Date;
referenceEndDate?: Date;
startTitle?: string;
startSubtitle?: string;
startTab?: string;
endTitle?: string;
endSubtitle?: string;
endTab?: string;
dateTitle?: string;
dateSubtitle?: string;
timeTitle?: string;
timeSubtitle?: string;
};

Просмотреть файл

@ -0,0 +1,18 @@
import type { DatePickerNativeAndroidParameters } from './NativeDatePicker.types.android';
import type { DatePickerNativeIOSParameters } from './NativeDatePicker.types.ios';
export type DatePickerNativeSharedParameters = {
mode?: 'date' | 'dateTime' | 'dateRange' | 'dateTimeRange';
startDate?: Date;
endDate?: Date;
callback: (startDate: string, endDate: string) => void;
};
export type DatePickerNativeParameters = DatePickerNativeSharedParameters &
DatePickerNativeIOSParameters &
DatePickerNativeAndroidParameters;
export type NativeDatePickerInterface = {
present(params: DatePickerNativeParameters): void;
parseISOString(dateISOString: string): Date;
};