Skip to content

Latest commit

 

History

History
62 lines (47 loc) · 2.21 KB

README.md

File metadata and controls

62 lines (47 loc) · 2.21 KB

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