New: Introducing PHP and Composer Support.Read the Announcement
Socket
Book a DemoInstallSign in
Socket

@iftek/react-native-month-view-calendar

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iftek/react-native-month-view-calendar

Calendar month view to display events

latest
Source
npmnpm
Version
1.2.2
Version published
Maintainers
0
Created
Source

version downloads

@iftek/react-native-month-view-calendar

React Native Month View Calendar

 

Install

npm install --save @iftek/react-native-month-view-calendar

Basic usage

import React from 'react';
import MonthViewCalendar from '@iftek/react-native-month-view-calendar';
import { View, ScrollView } from 'react-native'

const Component = () => {
  const eventsForCalendar = [
  	{
  	  title: 'My awesome event',
  	  date: new Date(),
  	},
  ];

  return (
    <ScrollView>
      <MonthViewCalendar
        cellStyles={{ minHeight: 65 }}
        events={eventsForCalendar}
        renderEvent={(event, i) => {
          return (
            <Text key={i} numberOfLines={1}>{event.title}</Text>
          )
        }}
      />
    </ScrollView>
  );
}

Props

PropertiesDefaulttypeDescription
datenew Date()Date from which the calendar will be built
dayTextStyles{}TextStyle | (day:Date) => TextStyleStyles for label day(numer of day), can be function, array or object
todayTextStyles{}Styles for label day(today), can be array or object
otherMonthsDayTextStyles{}Styles for label day(numer of day) other months, can be array or object
otherMonthsEnabledfalseother months day cell onPress enabled or not
eventsArray of events
headerTextStyles{}Styles for label week day name, can be array or object
cellStyles{}ViewStyle | (day:Date) => ViewStyleStyles for all cells, can be function, array or object
pastMonthsCellStyles{}Styles for all cells from past dates
weekDays['S', 'M', 'T', 'W', 'T', 'F', 'S']Array with name of the day of the week
renderEventFunction required to render event information. Example (event, index) =>
onPressCallback when day cell is pressed
onSwipeCallback when calendar is swiped
onSwipePrevCallback when calendar is swiped to previous month
onSwipeNextCallback when calendar is swiped to next month
onScrollToIndexFailedCallback to handle errors on swipe

Methods

To use the component methods save a reference to it:

const reference = useRef();

<MonthViewCalendar
  ref={reference}
/>
  • goToDate(date): the component navigates to a custom date, date variable must be an instance of Date. Example: reference.current.goToDate(new Date());
  • getCurrentDate() returns current date that being displayed

Event object

{
  /// your props
  date: new Date(),
}

FAQs

Package last updated on 14 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts