Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gunnartorfis/react-native-week-month-date-picker

Date picker with a week and month view 📅
https://github.com/gunnartorfis/react-native-week-month-date-picker

date datepicker picker react react-native

Last synced: 3 months ago
JSON representation

Date picker with a week and month view 📅

Awesome Lists containing this project

README

        

# React Native Week Month Date Picker

Date picker with a week and month view

Demo

## Installation

```sh
npm install react-native-week-month-date-picker
```

#### Dependencies

This library needs these dependencies to be installed as peer dependencies in your project:

```bash
npm install react-native-reanimated react-native-gesture-handler react-native-safe-area-context date-fns
```

> follow [react-native-reanimated](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation), [react-native-gesture-handler](https://docs.swmansion.com/react-native-gesture-handler/docs/installation), and [react-native-safe-area-context](https://github.com/th3rdwave/react-native-safe-area-context#getting-started) installation guide to install native dependencies properly.

## Usage

```js
import { addDays } from 'date-fns';
import * as React from 'react';
import { SafeAreaView, StyleSheet, Text, View } from 'react-native';
import { DatePicker } from 'react-native-week-month-date-picker';

export default function App() {
const minDate = new Date();
const [selectedDate, setSelectedDate] = React.useState(new Date());

return (

setSelectedDate(date)}
disabledDates={[addDays(new Date(), 1), addDays(new Date(), 3)]}
allowsPastDates={false}
locale="en"
theme={{
primaryColor: 'purple',
}}
>

Timeslots
{selectedDate.toString()}



);
}
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT