1.0.0 • Published 6 years ago

react-native-jalaali-date-picker v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

React Native Jalaali (Persian) DatePicker

This is a Jalaali (Persian) Date Picker Component for React Native

The package is both Android and iOS compatible.

Installation

$ yarn add react-native-persian-date-picker

or

$ npm install react-native-persian-date-picker --save

Prerequisites

DatePicker requires Moment JS. Date props may be anything parseable by Moment: Javascript Date, Moment date, or ISO8601 datetime string.

Usage

How to use it:

import React, {Component} from 'react';
import DatePicker from './persianDatePicker'

export default class App extends Component {
    render() {
        return (
            <DatePicker
                showTitleDate={true}
                onChangeDate={(date)=>{
                console.log(date)
            }}
            />
        );
    }
}

PersianCalendarPicker props

PropTypeDescription
defDateMoment dateOptional. Open date picker with custome date. Default is today
defDateStringStringsOptional. Open date picker with custome string . Eg. 2017/02/04
styleViewStyleOptional. Main Datepicker style . Default is '{}'
showTitleDateBooleanOptional. Show current date in the header of date picker . Default is false
titleDateFormatStringOptional. Change format of header date . Default is dddd - jMM - jYYYY
TitleDateStyleViewStyleOptional. Change style of header dare. Default is {}
btnColorStringOptional. BackgroundColor for Top and bottom Buttons
btnStyleViewStyleOptional. Style Bottom and Top Buttons.
btnUnderlayColorStringOptional. UderlayColor colors for buttons
arrowTintColorStringOptional. Change color of buttons arrow .
arrowSizeNumberOptional. Change arrows size .
dateBoxStyleViewStyleOptional. Middle date box style .
dateStyleViewStyleOptional. Change current date style like fontFamily , color , FontSize .
onChangeDateFunctionOptional. return date on changing

Styles

Some styles will overwrite some won't. For instance:

  • If you provide textStyle with fontFamily and color, out of ranges dates will not apply your color, just fontFamily.

Order of precedence:

  • defaultColor => textStyle => selectedDayColor
  • defaultTodayBackgroundColor => todayBackgroundColor
  • defaultBackgroundColor => selectedDayColor
  • defaultTextStyles => textStyle => selectedDayTextColor

Suggestions?

Open Issues. Submit PRs.