/react-native-lunar-calendar

A react-native lunar calendar project for android and ios.

Primary LanguageJavaScript

react-native-lunar-calendar

Known Vulnerabilities npm download

A lunar calendar component for react-native.

GitHub

Getting Started

$ npm install react-native-lunar-calendar --save
import Calender from "react-native-lunar-calendar";

...
render() {
  return (
    <Calendar
        headerStyle={{backgroundColor: '#f00'}}
        weekHeadStyle={{backgroundColor: '#00f'}}
        onDateSelect={(date) => console.log(date)}
        onMonthSelect={(mon) => console.log(mon)}
        dateStyle={{backgroundColor: '#f0f'}}
        selectDateStyle={{backgroundColor: '#f00'}}
        weekendStyle={{backgroundColor: '#fff'}}
        style={{backgroundColor: '#0f0'}} />
  )
}
...

API

  • style

    name type description
    style object style of main page
    weekHeadStyle object style of head of week show
    headerStyle object style of head of year show
    dateStyle object date tab style
    selectDateStyle object style of date tab where selected
  • callback

    name type description
    onDateSelect callback function: (date) => {} the function will be called when select date on body
    onMonthSelect callback function: (month) => {} the function will be called when select date on header