1.1.2 β€’ Published 11 months ago

@fowusu/calendar-kit v1.1.2

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

Introduction

A simple and customizable React Native component for displaying and interacting with Gregorian calendar dates. @fowusu/calendar-kit

Features

  • πŸ’‘ 100% Typescript
  • ⚑️ Build with @shopify/flashlist for faster list rendering
  • πŸ•‘ Works in all timezones
  • 🎨 Fully customizable with example use cases
  • 🈲 Supports localization
  • πŸš€ DX, UX and Performance in one lightweight bundle
  • πŸ—“οΈ Multiview calendars (Weekβœ…, Monthβœ…, Yearly(coming soon)βš™οΈ)
  • πŸ‘¨πŸ½β€πŸ’» Works in every RN project including react native web

Examples

Vio.comAirbnb
PricelineBooking.com
LocalizedPerformance
Multiview (Week & Year)Schedule

Installation

To install the package, use npm or yarn:

npm install @fowusu/calendar-kit

or

yarn add @fowusu/calendar-kit

or

yarn expo add @fowusu/calendar-kit

⚠️ You need to install @shopify/flash-list

yarn add @shopify/flash-list
yarn expo add @shopify/flash-list

Usage

Here’s a basic example of how to use the @fowusu/calendar-kit package:

Calendar

import React, { useCallback, useState } from "react";
import { Calendar, toLocaleDateString } from "@fowusu/calendar-kit";

const today = new Date();

const todayDateString = toLocaleDateString(today);

const CalendarComponent = () => {
  const [selectedDay, setSelectedDay] = useState<string>();

  const onDayPress = useCallback((dateString) => {
    setSelectedDay(dateString);
  }, []);

  return (
    <Calendar
      date={todayDateString}
      markedDates={[selectedDay]}
      onDayPress={onDayPress}
    />
  );
};

CalendarList

import React, { useCallback, useState } from "react";
import {CalendarList, toLocaleDateString} from "@fowusu/calendar-kit";

const today = new Date();
const todayDateString = toLocaleDateString(today);

const CalendarListComponent = () => {
    const [selectedDay, setSelectedDay] = useState<string>();
    
    const onDayPress = useCallback((dateString) => {
        setSelectedDay(dateString);
    }, []);

  return (
    <CalendarList
      currentDate={todayDateString}
      estimatedCalendarSize={{
          fiveWeekCalendarSize: 400
      }}
      markedDates={[selectedDay]}
      futureMonthsCount={12}
      pastMonthsCount={0}
      onDayPress={onDayPress}
    />
  );
};

API Reference

See our API Reference docs

Contributing

Contributions are welcome! Please see the CONTRIBUTING.md for guidelines.

1.1.1

1 year ago

1.1.0

1 year ago

1.0.3-beta.0

1 year ago

1.0.3-beta.2

1 year ago

1.0.3-beta.1

1 year ago

1.0.3-beta.4

1 year ago

1.0.3-beta.3

1 year ago

1.1.2

11 months ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago