New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-native-inline-datepicker

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-inline-datepicker

A simple android and ios datepicker which will be rendered inline with other react-native components.

latest
Source
npmnpm
Version
1.2.1
Version published
Weekly downloads
1.2K
16.67%
Maintainers
1
Weekly downloads
 
Created
Source

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. The component can be used for both android and ios apps.

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("white", "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 "white", "red", "green" or "blue" with the following effects.

Default

Screenshot

skinColor = 'white'

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.

Keywords

DatePicker

FAQs

Package last updated on 05 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts