1.0.6 • Published 6 years ago

react-native-whc-calendar v1.0.6

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

react-native-whc-calendar

A react native module to show calendar, it works on iOS and Android.

release PRs Welcome NPM version License MIT 语言 中文

Content

Installation

  • 1.Run npm install react-native-whc-calendar --save
  • 2.import Calendar from 'react-native-whc-calendar'

Demo

Getting started

Add react-native-whc-calendar to your js file.

import Calendar from 'react-native-whc-calendar'

Inside your component's render method, use Calendar:

 render() {
         return (
             <Calendar
                 days={30}
             />
         );
 }

Basic usage

render() {
        return (
           <Calendar
               days={30}
               onSelectedDateBlock={(s,e) => {
                  /// 返回选择的日期
               }
           }/>
        );
    }

API

PropsTypeOptionalDefaultDescription
daysPropTypes.numbertrue0Specified date days
monthsPropTypes.numbertrue0Specified date months
startYearPropTypes.numbertrue0Specified date start year
endYearPropTypes.numbertrue0Specified date end year
startDateStrPropTypes.stringtruenulldefault choice start date
endDateStrPropTypes.stringtruenulldefault choice end date
startSelectedHintPropTypes.stringtruenulldefault choice start date hint
endSelectedHintPropTypes.stringtruenulldefault choice end date hint
onSelectedDateBlockPropTypes.functruenullchoice date callback func
selectedColorPropTypes.stringtruenulldefault choice date back color
selectedMidColorPropTypes.stringtruenulldefault choice min date back color
selectedTextColorPropTypes.stringtruenulldefault choice date text color
highlightColorPropTypes.stringtruenulldefault date holiday color
enableSingleChoicePropTypes.booltruefalseenable single one date
invalidDateNotSelectedPropTypes.booltruetruedefault not choice invalid date

Contribution

Issues are welcome. Please add a screenshot of bug and code snippet. Quickest way to solve issue is to reproduce it on one of the examples.

Pull requests are welcome. If you want to change API or making something big better to create issue and discuss it first.


MIT Licensed