npm.io
1.2.4 • Published 3 years ago

react-native-daily-calendar

Licence
MIT
Version
1.2.4
Deps
0
Size
137 kB
Vulns
0
Weekly
0

react-native-daily-calendar

A highly customizable Month and Date Picker component for React Native using momentjs. Support this project with a ★ on Github.

Alt text

Installation

You can install this package using either Yarn or NPM.

Alt text

npm install react-native-daily-calendar
Alt text
yarn add react-native-daily-calendar

react-native-daily-calendar requires moment to be installed, which is a peer dependency.

Usage

import DailyCalendar from 'react-native-daily-calendar';

function App() {
   const [selectedDate, setSelectedDate] = useState(moment().format("DD-MM-YYYY"))
  return (
   <DailyCalendar
     onDateChangeCalendar={value => {
     setSelectedDate(moment(value, 'YYYY-MM-DD').format('DD-MM-YYYY'));
     }}
    />
  );
}
Alt text

Props

Property Type Default Description
isMonthPickerReq bool true Boolean for month picker.
isDatePickerReq bool true Boolean for date picker.
onDateChangeCalendar function null Callback called when the user changing the date.
onMonthChangeCalendar function null Callback called when the user changing the month.
monthContainerStyle ViewStyle null Custom styling for month container
LeftArrowIcon JSX.Element Default Icon Month Picker Right Icon slider.
RightArrowIcon JSX.Element Default Icon Month Picker left Icon slider.
monthTextStyle TextStyle - Custom styling for Month Name.
dateStyle TextStyle - Custom styling for date.
dayStyle TextStyle - Custom styling for day.
activeDateColor String - Background color for active date.
dateContainerStyle ViewStyle - Custom styling for date tabs.
dayFormat string ddd Custom day format for days
CustomMonthComponent JSX.Element Default Month View Custom Month Container

Demo

You can try the example app by cloning this repo and running the following commands:

cd example
yarn install
npx expo start

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request if you find a bug or have a feature request. See the contributing guide to learn how to contribute to the repository and the development workflow.

License

This project is licensed under the MIT License.

Keywords