1.2.0 • Published 4 years ago

react-native-inline-datepicker v1.2.0

Weekly downloads
153
License
ISC
Repository
github
Last release
4 years ago

react-native-inline-datepicker

npm version npm downloads

This is a datepicker component for react-native apps which will be rendered inline with other components. Note that this component is applicable for android apps only.

Getting Started

Installation

$ npm install react-native-inline-datepicker --save

Usage

Import

import InlineDatePicker from 'react-native-inline-datepicker';

Example

import InlineDatePicker from 'react-native-inline-datepicker';
import React, { Component } from 'react';
import { View, Text } from 'react-native';

export default class DatePickerDemo extends Component {
  state = {
    year: 2019,
    month: 4,
    date: 24
  };
  setDate = (y, m, d) => {
    this.setState({year: y, month: m, date: d});
  }
  render() {
    return (
            <View>
              <InlineDatePicker onChangeDate = {this.setDate}/>
              <Text>The selected date is:</Text>
              <Text>{this.state.year}-{this.state.month}-{this.state.date}</Text>    
            </View>
    );
  }
}

The screenshot for the above code can be found here.

Props

PropDefaultTypeDescription
onChangeDatenullfuncCallback function taking three arguments (year, month, date) to take the user selected year, month and date respectively.
startDatenullArrayAn array containing three numbers to set the current date of the datepicker. The first element is the year, the second element is the month number ( 0 = January ... 11 = December). If this prop is not defined, the current date on the datepicker will be set to the current date on the user's device.
skinColornullenum("red", "green", "blue")Predefined skin colors for the date picker which provides style alternatives without defining the color properties described below. See below for effects.
fontSize18numberThe font size of all the texts in the datepicker except the title.
titleFontSize20numberThe font size of the title.
textColor#dddstringText color all texts in the current month.
activeTextColor#dddstringText color of selected date or month.
adjacentTextColor#cccstringText color of ajacent months.
iconSize22numberThe size of the increment icons.
headerBackgroundColor#222stringBackground color of the header.
currentMonthBackgroundColor#555stringBackground color of the dates within the current month or the months which appear when the header is clicked.
adjacentMonthsBackgroundColor#888stringBackground color of the dates in the adjacent months.
selectedDateBackgroundColor#000stringBackground color of the selected date.

skinColor prop

The optional skinColor property can have values of "red", "green" or "blue" with the following effects.

Default

Screenshot

skinColor = 'red'

Screenshot

skinColor = 'green'

Screenshot

skinColor = 'blue'

Screenshot

Issues or suggestions?

If you have any issues or want to suggest something , your can write it here.

1.2.0

4 years ago

1.1.0

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago