Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions docsRNC/docs/Agenda.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Agenda component
[(code example)](https://github.com/wix/react-native-calendars/blob/master/example/src/screens/agenda.tsx)
:::info
This component extends **[CalendarList, FlatList](https://github.com/wix/react-native-calendars/blob/master/src/calendar-list/index.tsx,https://reactnative.dev/docs/flatlist)** props.
:::
<div style={{display: 'flex', flexDirection: 'row', overflowX: 'auto', maxHeight: '500px', alignItems: 'center'}}><img style={{maxHeight: '420px'}} src={'https://github.com/wix/react-native-calendars/blob/master/demo/assets/agenda.gif?raw=true'}/>

</div>

## API
### items
the list of items that have to be displayed in agenda. If you want to render item as empty date the value of date key has to be an empty array []. If there exists no value for date key it is considered that the date in question is not yet loaded
<span style={{color: 'grey'}}>AgendaSchedule</span>

### loadItemsForMonth
Handler which gets executed when items for a certain month should be loaded (month became visible)
<span style={{color: 'grey'}}>(data: DateData) => void</span>

### onDayChange
Handler which gets executed when day changes while scrolling agenda list
<span style={{color: 'grey'}}>(data: DateData) => void</span>

### onCalendarToggled
Handler which gets executed when the calendar is opened or closed
<span style={{color: 'grey'}}>(enabled: boolean) => void</span>

### selected
initially selected day
<span style={{color: 'grey'}}>string</span>

### renderKnob
Replace default agenda's knob with a custom one
<span style={{color: 'grey'}}>() => JSX.Element</span>

### hideKnob
Whether to hide the knob
<span style={{color: 'grey'}}>boolean</span>

### showClosingKnob
Whether the knob should always be visible (when hideKnob = false)
<span style={{color: 'grey'}}>boolean</span>

### showOnlySelectedDayItems
Whether to show items only for the selected date
<span style={{color: 'grey'}}>boolean</span>

### renderEmptyData
Replace default ActivityIndicator with a custom one
<span style={{color: 'grey'}}>() => JSX.Element</span>

47 changes: 47 additions & 0 deletions docsRNC/docs/AgendaList.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Agenda list component for the `ExpandableCalendar` component.
[(code example)](https://github.com/wix/react-native-calendars/blob/master/example/src/screens/expandableCalendar.tsx)
:::info
This component extends **[FlatList](https://reactnative.dev/docs/flatlist)** props.
:::
**NOTE: This component should be wrapped with `CalendarProvider` component.**
<div style={{display: 'flex', flexDirection: 'row', overflowX: 'auto', maxHeight: '500px', alignItems: 'center'}}><img style={{maxHeight: '420px'}} src={'https://github.com/wix/react-native-calendars/blob/master/demo/assets/expandable-calendar.gif?raw=true'}/>

</div>

## API
### theme
Specify theme properties to override specific styles for calendar parts
<span style={{color: 'grey'}}>Theme</span>

### dayFormat
Day format in section title. Formatting values: http://arshaw.com/xdate/#Formatting
<span style={{color: 'grey'}}>string</span>

### dayFormatter
A function to custom format the section header's title
<span style={{color: 'grey'}}>(arg0: string) => string</span>

### useMoment
Whether to use moment.js for date string formatting
<span style={{color: 'grey'}}>boolean</span>

### markToday
Whether to mark today's title with the 'Today, ...' string
<span style={{color: 'grey'}}>boolean</span>

### avoidDateUpdates
Whether to block the date change in calendar (and calendar context provider) when agenda scrolls
<span style={{color: 'grey'}}>boolean</span>

### scrollToNextEvent
Whether to enable scrolling the agenda list to the next date with content when pressing a day without content
<span style={{color: 'grey'}}>boolean</span>

### viewOffset
Offset scroll to the section
<span style={{color: 'grey'}}>number</span>

### sectionStyle
The style passed to the section view
<span style={{color: 'grey'}}>ViewStyle</span>

162 changes: 162 additions & 0 deletions docsRNC/docs/Calendar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
Calendar component
[(code example)](https://github.com/wix/react-native-calendars/blob/master/example/src/screens/calendars.tsx)
:::info
This component extends **[CalendarHeader, BasicDay](https://github.com/wix/react-native-calendars/blob/master/src/calendar/header/index.tsx,https://github.com/wix/react-native-calendars/blob/master/src/calendar/day/basic/index.tsx)** props.
:::
<div style={{display: 'flex', flexDirection: 'row', overflowX: 'auto', maxHeight: '500px', alignItems: 'center'}}><img style={{maxHeight: '420px'}} src={'https://github.com/wix/react-native-calendars/blob/master/demo/assets/calendar.gif?raw=true'}/>

</div>

## API
### testID
Test ID
<span style={{color: 'grey'}}>string</span>

### theme
Specify theme properties to override specific styles for calendar parts
<span style={{color: 'grey'}}>Theme</span>

### style
Specify style for calendar container element
<span style={{color: 'grey'}}>ViewStyle</span>

### headerStyle
Specify style for calendar header
<span style={{color: 'grey'}}>ViewStyle</span>

### customHeader
Allow rendering a totally custom header
<span style={{color: 'grey'}}>any</span>

### initialDate
Initially visible month
<span style={{color: 'grey'}}>string</span>

### minDate
Minimum date that can be selected, dates before minDate will be grayed out
<span style={{color: 'grey'}}>string</span>

### maxDate
Maximum date that can be selected, dates after maxDate will be grayed out
<span style={{color: 'grey'}}>string</span>

### allowSelectionOutOfRange
Whether to allow selection of dates before minDate or after maxDate
<span style={{color: 'grey'}}>boolean</span>

### firstDay
If firstDay=1 week starts from Monday. Note that dayNames and dayNamesShort should still start from Sunday
<span style={{color: 'grey'}}>number</span>

### markedDates
Collection of dates that have to be marked
<span style={{color: 'grey'}}>MarkedDatesType</span>

### displayLoadingIndicator
Whether to display loading indicator
<span style={{color: 'grey'}}>boolean</span>

### showWeekNumbers
Whether to show weeks numbers
<span style={{color: 'grey'}}>boolean</span>

### hideExtraDays
Whether to hide days of other months in the month page
<span style={{color: 'grey'}}>boolean</span>

### showSixWeeks
Whether to always show six weeks on each month (when hideExtraDays = false)
<span style={{color: 'grey'}}>boolean</span>

### disableMonthChange
Whether to disable changing month when click on days of other months (when hideExtraDays = false)
<span style={{color: 'grey'}}>boolean</span>

### enableSwipeMonths
Whether to enable the option to swipe between months
<span style={{color: 'grey'}}>boolean</span>

### disabledByDefault
Whether to disable days by default
<span style={{color: 'grey'}}>boolean</span>

### disabledByWeekDays
Disable dates by days of the week (Sunday=0)
<span style={{color: 'grey'}}>number[]</span>

### onDayPress
Handler which gets executed on day press
<span style={{color: 'grey'}}>(date: DateData) => void</span>

### onDayLongPress
Handler which gets executed on day long press
<span style={{color: 'grey'}}>(date: DateData) => void</span>

### onMonthChange
Handler which gets executed when month changes in calendar
<span style={{color: 'grey'}}>(date: DateData) => void</span>

### onVisibleMonthsChange
Handler which gets executed when visible month changes in calendar
<span style={{color: 'grey'}}>(months: DateData[]) => void</span>

### monthFormat
Month format for the header's title. Formatting values: http://arshaw.com/xdate/#Formatting
<span style={{color: 'grey'}}>string</span>

### hideDayNames
Whether to hide the days names
<span style={{color: 'grey'}}>boolean</span>

### hideArrows
Whether to hide the arrows
<span style={{color: 'grey'}}>boolean</span>

### arrowsHitSlop
undefined
<span style={{color: 'grey'}}>null | Insets | number</span>

### disableArrowLeft
Whether to disable the left arrow
<span style={{color: 'grey'}}>boolean</span>

### disableArrowRight
Whether to disable the right arrow
<span style={{color: 'grey'}}>boolean</span>

### renderArrow
Replace default arrows with custom ones (direction: 'left' | 'right')
<span style={{color: 'grey'}}>(direction: Direction) => ReactNode</span>

### onPressArrowLeft
Handler which gets executed when press left arrow. It receive a callback to go to the previous month
<span style={{color: 'grey'}}>(method: () => void, month?: string) => void</span>

### onPressArrowRight
Handler which gets executed when press right arrow. It receive a callback to go to the next month
<span style={{color: 'grey'}}>(method: () => void, month?: string) => void</span>

### disabledDaysIndexes
Whether to apply custom disable color to selected day names indexes
<span style={{color: 'grey'}}>number[]</span>

### renderHeader
Replace default title with custom one
<span style={{color: 'grey'}}>(date?: string) => ReactNode</span>

### customHeaderTitle
Replace default title with custom element
<span style={{color: 'grey'}}>JSX.Element</span>

### dayComponent
Replace default day with custom day rendering component
<span style={{color: 'grey'}}>JSX.Element</span>

### disableAllTouchEventsForDisabledDays
Whether to disable all touch events for disabled days (can be override with 'disableTouchEvent' in 'markedDates')
<span style={{color: 'grey'}}>boolean</span>

### disableAllTouchEventsForInactiveDays
Whether to disable all touch events for inactive days (can be override with 'disableTouchEvent' in 'markedDates')
<span style={{color: 'grey'}}>boolean</span>

38 changes: 38 additions & 0 deletions docsRNC/docs/CalendarList.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Calendar list component
[(code example)](https://github.com/wix/react-native-calendars/blob/master/example/src/screens/calendarsList.tsx)
:::info
This component extends **[Calendar, FlatList](https://github.com/wix/react-native-calendars/blob/master/src/calendar/index.tsx,https://reactnative.dev/docs/flatlist)** props.
:::
<div style={{display: 'flex', flexDirection: 'row', overflowX: 'auto', maxHeight: '500px', alignItems: 'center'}}><img style={{maxHeight: '420px'}} src={'https://github.com/wix/react-native-calendars/blob/master/demo/assets/calendar-list.gif?raw=true'}/>

</div>

## API
### pastScrollRange
Max amount of months allowed to scroll to the past
<span style={{color: 'grey'}}>number</span>

### futureScrollRange
Max amount of months allowed to scroll to the future
<span style={{color: 'grey'}}>number</span>

### calendarStyle
Specify style for calendar container element
<span style={{color: 'grey'}}>ViewStyle</span>

### calendarHeight
Dynamic calendar height
<span style={{color: 'grey'}}>number</span>

### calendarWidth
Used when calendar scroll is horizontal, (when pagingEnabled = false)
<span style={{color: 'grey'}}>number</span>

### staticHeader
Whether to use a fixed header that doesn't scroll (when horizontal = true)
<span style={{color: 'grey'}}>boolean</span>

### showScrollIndicator
Whether to enable or disable vertical / horizontal scroll indicator
<span style={{color: 'grey'}}>boolean</span>

56 changes: 56 additions & 0 deletions docsRNC/docs/CalendarProvider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Calendar context provider component
[(code example)](https://github.com/wix/react-native-calendars/blob/master/example/src/screens/expandableCalendar.tsx)
:::info
This component extends **[Context](https://reactjs.org/docs/context.html)** props.
:::
<div style={{display: 'flex', flexDirection: 'row', overflowX: 'auto', maxHeight: '500px', alignItems: 'center'}}></div>

## API
### theme
Specify theme properties to override specific styles for calendar parts
<span style={{color: 'grey'}}>Theme</span>

### style
Specify style for calendar container element
<span style={{color: 'grey'}}>ViewStyle</span>

### date
Initial date in 'yyyy-MM-dd' format
<span style={{color: 'grey'}}>string</span>

### onDateChanged
Handler which gets executed when the date changes
<span style={{color: 'grey'}}>(date: string, updateSource: UpdateSource) => void</span>

### onMonthChange
Handler which gets executed when the month changes
<span style={{color: 'grey'}}>(date: DateData, updateSource: UpdateSource) => void</span>

### disableAutoDaySelection
The calendar navigation type in which to disable the auto day selection (get options from ExpandableCalendar.navigationTypes)
<span style={{color: 'grey'}}>CalendarNavigationTypes[]</span>

### showTodayButton
Whether to show the today button
<span style={{color: 'grey'}}>boolean</span>

### todayButtonStyle
Today button's style
<span style={{color: 'grey'}}>ViewStyle</span>

### todayBottomMargin
Today button's top position
<span style={{color: 'grey'}}>number</span>

### disabledOpacity
The opacity for the disabled today button (0-1)
<span style={{color: 'grey'}}>number</span>

### numberOfDays
The number of days to present in the timeline calendar (1-7)
<span style={{color: 'grey'}}>number</span>

### timelineLeftInset
The left inset of the timeline calendar (sidebar width)
<span style={{color: 'grey'}}>number</span>

Loading