0.1.0 • Published 9 months ago

react-native-calender-view v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

react-native-calender-view

Calendar UI view for react native apps

Installation

npm install react-native-calender-view

Usage

import CalenderView from 'react-native-calender-view';

// ...

<CalenderView
  onDatePress={(date, events) => console.log('Date Pressed', date, events)}
/>;

Props

namedescriptiontypedefault
dateInitial date showned dateDatetoday
markedDatesSee below for more detailsReactNode-
onDatePressDate Press function which gives date and events has a paramsFunction-
selectedDateStyleSelected date styleViewStyle-
selectedDateColorSelected Date ColorColorValue-
weekContainerStyleweek contianer stylesViewStyle-
containerStyleContainer StyleViewStyle-
dateStyleDate Style mostly used for coloring the boxViewStyle-
weekEndColorUsed for assign color for weekends datesColorValue-

markedDates

object which is accept dates has formatted DD-MM-YYYY dates to show on that date is any event was present or not.

TypeRequired
objectNo
import CalenderView, { getFormattedDDMMYYYY } from 'react-native-calender-view';


const today = getFormattedDDMMYYYY(new Date()) // this utility function auto format date to required format which accepts "Date" has param
// ...

<CalenderView
  onDatePress={(date, events) => console.log('Date Pressed', date, events)}
  markedDates={{
    ['20-02-2023']: {
      events: [''], // Event array which would be return when "onDatePress"
    },
    [today]: {
        style?: ViewStyle,
        events?: any[],
        dotColors?: ColorValue[]
    }
  }}
/>;

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library