Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ReScript bindings for @react-native-community/datetimepicker

License

NotificationsYou must be signed in to change notification settings

rescript-react-native/datetimepicker

Build StatusVersionReScript Forum

ReScript bindings for@react-native-community/datetimepicker.

Exposed as theReactNativeDateTimePicker module.

Version x.y.z of@rescript-react-native/datetimepicker is intended to becompatible with version x.y.z of@react-native-community/datetimepicker.

Installation

When@react-native-community/datetimepickeris properly installed & configured by following their installation instructions,you can install the bindings:

npm install @rescript-react-native/datetimepicker#oryarn add @rescript-react-native/datetimepicker

@rescript-react-native/datetimepicker should be added tobs-dependencies inyourbsconfig.json. For example,

{  //...  "bs-dependencies": [    "@rescript/react",    "rescript-react-native",    // ...+    "@rescript-react-native/datetimepicker"  ],  //...}

Usage

Types

locale = string

Refer todocumentationfor valid values.

PickerEvent.t

AssumingpickerEvent isPickerEvent.t, you can access

pickerEvent.nativeEvent.target// => option(int)pickerEvent.nativeEvent.timestamp// => int

Note thattarget is undefined on Android.

Props

All props other thanvalue are optional.

value: Js.Date.t

required

Current value for time and date.

maximumDate: Js.Date.t

Latest date that can be selected. For examplemaximumDate = Js.Date.makeWithYMD(2020., 10., 15., ()). Note that months arenumbered from0.

minimumDate: Js.Date.t

Earliest date that can be selected. For exampleminimumDate = Js.Date.makeWithYMD(2015., 0., 18., ()). Note that months arenumbered from0.

mode: [ | `date | `time | `datetime | `countdown]

Type of the picker. Note that

  • `date is the default
  • `datetime and`countdown are iOS only

display: [ | `default | `spinner | `calendar | `clock]

Android only

How the picker is displayed. Note that

  • `calendar is only formode=`date
  • `clock is only formode=`time

onChange: (pickerEvent, Js.Date.t) => unit

  • pickerEvent has keysnativeEvent on both platforms and also_type onAndroid.

  • Android:_type key takes value"set" (when the dialog is closed via"OK") or"dismissed" (when the dialog is closed via "cancel").

timeZoneOffsetInMinutes: int

iOS only

Allows changing time zone of the date picker. By default device's time zone isused. As an example, set to60 for GMT+1.

locale: locale

iOS only

Allows changing locale of the component. By default device's locale is used.

Refer todocumentationfor valid values.

is24Hour: bool

Android only.

Allows changing of the time picker to a 24 hour format. Default is false.

minuteInterval: [ |_1 |_2 |_3 |_4 |_5 |_6 |_10 |_12 |_15 |_20 |_30 ]`

iOS only.

Interval at which minutes can be selected. Polymorphic constructors are renderedto string (that is`_3 becomes"3").


Changelog

Check thechangelog for more information about recentreleases.

Contribute

Read thecontribution guidelines before contributing.

Code of Conduct

We want this community to be friendly and respectful to each other. Please readour full code of conduct so that you can understand whatactions will and will not be tolerated.

About

ReScript bindings for @react-native-community/datetimepicker

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp