### Install Calendar-Kit and FlashList Source: https://github.com/f0wu5u/calendar-kit/blob/main/_autodocs/README.md Install the calendar-kit package along with Shopify's FlashList for efficient rendering. This is the initial setup step for using the library. ```bash npm install @fowusu/calendar-kit @shopify/flash-list ``` -------------------------------- ### Basic Single-Month Calendar Setup Source: https://github.com/f0wu5u/calendar-kit/blob/main/_autodocs/api-reference/configuration.md Set up a simple single-month calendar component. This example shows how to manage a selected date. ```typescript import React, { useState } from "react" import { Calendar, toLocaleDateString } from "@fowusu/calendar-kit" const App = () => { const [selectedDate, setSelectedDate] = useState() return ( ) } export default App ``` -------------------------------- ### Install Calendar Kit Source: https://github.com/f0wu5u/calendar-kit/blob/main/_autodocs/api-reference/configuration.md Install the library using npm or yarn. Ensure you also install the peer dependencies. ```bash npm install @fowusu/calendar-kit # or yarn add @fowusu/calendar-kit ``` ```bash npm install @shopify/flash-list react react-native ``` -------------------------------- ### Minimal Calendar Example Source: https://github.com/f0wu5u/calendar-kit/blob/main/_autodocs/overview.md Demonstrates the basic setup for using the Calendar component, including state management for day selection and date formatting. ```typescript import { Calendar, toLocaleDateString } from "@fowusu/calendar-kit" import { useState } from "react" export default function App() { const [selected, setSelected] = useState() return ( ) } ``` -------------------------------- ### Localization Example: Weekday Name Formatting Source: https://github.com/f0wu5u/calendar-kit/blob/main/_autodocs/overview.md Demonstrates retrieving an array of localized weekday names for a given locale and format. This example shows how to get long weekday names for German. ```javascript // Weekday names getLocaleWeekDayNames("de-DE", "long") // ["Sonntag", "Montag", "Dienstag", ...] ``` -------------------------------- ### Start Calendar Kit Project Source: https://github.com/f0wu5u/calendar-kit/blob/main/example/README.md Run this command to start the main Calendar Kit project. ```bash yarn start ``` -------------------------------- ### Install Dependencies Source: https://github.com/f0wu5u/calendar-kit/blob/main/CONTRIBUTING.md Install all necessary project dependencies using Yarn. ```bash yarn install ``` -------------------------------- ### Install Calendar Kit Source: https://github.com/f0wu5u/calendar-kit/blob/main/README.md Install the calendar-kit package using npm, yarn, or expo. ```bash npm install @fowusu/calendar-kit ``` ```bash yarn add @fowusu/calendar-kit ``` ```bash yarn expo add @fowusu/calendar-kit ``` -------------------------------- ### Install Flash List Source: https://github.com/f0wu5u/calendar-kit/blob/main/README.md Install the required @shopify/flash-list dependency for faster list rendering. ```bash yarn add @shopify/flash-list ``` ```bash yarn expo add @shopify/flash-list ``` -------------------------------- ### Start Calendar Kit for React Native Web Source: https://github.com/f0wu5u/calendar-kit/blob/main/example/README.md Use this command to start the Calendar Kit project specifically for React Native web. ```bash yarn web ``` -------------------------------- ### Localization Example: Month Name Formatting Source: https://github.com/f0wu5u/calendar-kit/blob/main/_autodocs/overview.md Shows how to format month names according to a specific locale using the `formatMonthName` function. This example demonstrates formatting for French. ```javascript // Month names formatMonthName(new Date(2024, 5), "fr-FR") // "juin 2024" ``` -------------------------------- ### Custom Day State Logic with Booking Example Source: https://github.com/f0wu5u/calendar-kit/blob/main/_autodocs/api-reference/configuration.md Implement custom state logic for days using 'customStateCreator'. This example defines a 'BookingState' interface and a creator function to determine booking status, availability, and price. ```typescript import { StateInputParams, DayState } from "@fowusu/calendar-kit" interface BookingState { isBooked: boolean hasAvailability: boolean price: number } const createBookingState = ( params: StateInputParams, defaultState: DayState ): BookingState => ({ isBooked: params.markedDates.includes(params.dateString), hasAvailability: Math.random() > 0.3, price: Math.floor(Math.random() * 300 + 50), }) const BookingDay: React.FC> = ({ day, state, hasAvailability, price }) => ( {day.getDate()} {hasAvailability && ${price}} ) // Usage: ``` -------------------------------- ### Clone Repository Source: https://github.com/f0wu5u/calendar-kit/blob/main/CONTRIBUTING.md Clone your forked repository to your local machine to start making changes. ```bash git clone https://github.com/your-username/your-repo-name.git ``` -------------------------------- ### Localization Example (Spanish with Custom Weekdays) Source: https://github.com/f0wu5u/calendar-kit/blob/main/_autodocs/overview.md Shows how to set the locale to Spanish (`es-ES`) and provide custom short weekday names. ```typescript // Spanish with custom weekday names ``` -------------------------------- ### Single Month Picker Example Source: https://github.com/f0wu5u/calendar-kit/blob/main/_autodocs/README.md A simple example of a single-month calendar picker. It displays the current date and allows users to select a single day. ```typescript setSelectedDate(date)} /> ``` -------------------------------- ### Horizontal Week Scroller Example Source: https://github.com/f0wu5u/calendar-kit/blob/main/_autodocs/api-reference/CalendarList.md An example demonstrating a horizontal week scroller. It utilizes a ref to scroll to the current day and displays day names. ```typescript import React, { useRef } from "react" import { CalendarList, toLocaleDateString, CalendarListRef } from "@fowusu/calendar-kit" import { Button, View } from "react-native" const WeekScroller = () => { const ref = useRef(null) const today = toLocaleDateString(new Date()) return (