Browse Source

Updated readme.

master
Henning Hall 7 years ago
parent
commit
63b79df422
2 changed files with 14 additions and 41 deletions
  1. +14
    -41
      README.md
  2. BIN
      docs/colors-android.png

+ 14
- 41
README.md View File

@ -27,20 +27,10 @@
</tr>
</table>
</div>
## Installation
`npm install react-native-date-picker-x `
<br>
or <br>
`yarn add react-native-date-picker-x`
<br>
<br>
`react-native link `
1. `npm install react-native-date-picker-x --save` or `yarn add react-native-date-picker-x`
2. `react-native link `
## Minimal Example
@ -60,37 +50,20 @@ export default class App extends Component {
/>
}
```
## Extended Example
```js
import React, { Component } from 'react';
import DatePicker from 'react-native-date-picker-x';
const today = new Date();
const tomorrow = new Date(new Date().getTime() + 24 * 60 * 60 * 1000);
export default class App extends Component {
state = { date: new Date() }
render = () =>
<DatePicker
date={this.state.date}
onDateChange={date => this.setState({ date })}
locale={'en-US'}
minuteInterval={5}
minimumDate={today}
maximumDate={tomorrow}
textColor={'#ffffff'}
fadeToColor={'#000000'}
/>
}
```
## Properties
Prop | Description | Screenshots
------------ | ------------- | -------------
date | The currently selected date. |
onDateChange | Date change handler |
fadeToColor | Android picker is fading towords this background color. {color, 'none',} |
maximumDate | Maximum selectable date. |
minimumDate | Minimum selectable date |
minuteInterval | The interval at which minutes can be selected. | <img src="docs/minute-interval-ios.png" alt="Date picker minute interval IOS" height="120px" /><img src="docs/minute-interval-android.png" alt="Date picker minute interval Android" height="120px" />
mode | The date picker mode. {'datetime', 'date', 'time'} | <img src="docs/datetime-mode-ios.png" alt="Datetime mode ios" height="120px" /><img src="docs/datetime-mode-android.png" alt="datetime mode android" height="120px" /><img src="docs/date-mode-ios.png" alt="date mode ios" height="120px" /><img src="docs/date-mode-android.png" alt="date mode android" height="120px" /><img src="docs/time-mode-ios.png" alt="time mode ios" height="120px" /><img src="docs/time-mode-android.png" alt="time mode android" height="120px" />
locale | The locale for the date picker. Changes language, date order and am/pm preferences. Value needs to be a <a title="react native datepicker locale id" href="https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html">Locale ID.</a>| <img src="docs/locale-ios.png" alt="React Native Date picker locale language ios" height="120px" /><img src="docs/locale-android.png" alt="React Native Date picker locale language android" height="120px" />
textColor | Changes the text color. | <img src="docs/colors-ios.png" alt="text color background color ios" height="120px" /><img src="docs/colors-android.png" alt="Text color background color android" height="120px" />
## About
📅 &nbsp; React Native Date Picker is a cross platform component working on both iOS and Android. It uses the slightly improved DatePickerIOS on iOS and a custom picker on Android which has similar look and feel. The datetime mode might be particulary interesting if you looking for a way to avoid two different popup pickers on android.

BIN
docs/colors-android.png View File

Before After
Width: 484  |  Height: 294  |  Size: 37 KiB Width: 374  |  Height: 294  |  Size: 43 KiB

Loading…
Cancel
Save