Skip to content

Commit

Permalink
Merge pull request #119 from Kiarash-Z/develop
Browse files Browse the repository at this point in the history
v3.0.1
  • Loading branch information
Kiarash-Z committed Mar 11, 2020
2 parents 2457c14 + 44529da commit 207c484
Show file tree
Hide file tree
Showing 24 changed files with 33,815 additions and 169 deletions.
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
# react-modern-calendar-datepicker
[![Build Status](https://travis-ci.org/Kiarash-Z/react-modern-calendar-datepicker.svg?branch=master)](https://travis-ci.org/Kiarash-Z/react-modern-calendar-datepicker) [![codecov.io](https://codecov.io/github/kiarash-z/react-modern-calendar-datepicker/coverage.svg?branch=master)](https://codecov.io/github/kiarash-z/react-modern-calendar-datepicker?branch=master) ![npm](https://img.shields.io/npm/v/react-modern-calendar-datepicker)

A modern, beautiful, customizable date picker for React. For more information, please visit [website](https://kiarash-z.github.io/react-modern-calendar-datepicker)
A modern, beautiful, customizable date picker for React.

<a href="https://kiarash-z.github.io/react-modern-calendar-datepicker">
<img src="https://user-images.githubusercontent.com/20098648/67585012-9d05d300-f75b-11e9-82f1-cf3f03ab5a83.png" alt="hero image" />
<img src="https://user-images.githubusercontent.com/20098648/76241893-f6722880-624a-11ea-9a80-eace8a4a27f0.png" alt="hero image" />
</a>

## Installation 🚀
```bash
npm i react-modern-calendar-datepicker

# or if you prefer Yarn:
yarn add react-modern-calendar-datepicker
```

## Documentation 📄
You can find documentation on [the website.](https://kiarash-z.github.io/react-modern-calendar-datepicker/)

The documentation is divided into several sections:
- [Getting Started](https://kiarash-z.github.io/react-modern-calendar-datepicker/docs/getting-started)
- [Core Concepts](https://kiarash-z.github.io/react-modern-calendar-datepicker/docs/core-concepts)
- [Default Values](https://kiarash-z.github.io/react-modern-calendar-datepicker/docs/default-values)
- [Minimum & Maximum Date](https://kiarash-z.github.io/react-modern-calendar-datepicker/docs/minimum-maximum-date)
- [Disabled Days](https://kiarash-z.github.io/react-modern-calendar-datepicker/docs/disabled-days)
- [Customization](https://kiarash-z.github.io/react-modern-calendar-datepicker/docs/customization)
- [Responsive Guide](https://kiarash-z.github.io/react-modern-calendar-datepicker/docs/responsive-guide)
- [Utilities](https://kiarash-z.github.io/react-modern-calendar-datepicker/docs/utilities)
- [Different Locales](https://kiarash-z.github.io/react-modern-calendar-datepicker/docs/different-locales)
- [TypeScript](https://kiarash-z.github.io/react-modern-calendar-datepicker/docs/typescript)

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Expand Down
14 changes: 12 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export type DayRange = { from?: Day; to?: Day };

type Value = Day | Day[] | DayRange;

type CustomDayClassNameItem = Day & { className: string };

export interface CalendarProps<TValue extends Value> {
value: TValue;
onChange?(value: TValue): void;
Expand All @@ -30,6 +32,8 @@ export interface CalendarProps<TValue extends Value> {
calendarRangeStartClassName?: string;
calendarRangeBetweenClassName?: string;
calendarRangeEndClassName?: string;
renderFooter?: React.FC;
customDaysClassName?: CustomDayClassNameItem[];
}

export function Calendar(props: Optional<CalendarProps<Day>, 'value'>): React.ReactElement;
Expand All @@ -54,9 +58,15 @@ declare function DatePicker(props: Optional<DatePickerProps<Day>, 'value'>): Rea
declare function DatePicker(props: DatePickerProps<Day[]>): React.ReactElement;
declare function DatePicker(props: DatePickerProps<DayRange>): React.ReactElement;

type WeekDay = {
name: string;
short: string;
isWeekend?: boolean;
}

export type Utils = {
monthsList: string[];
weekDaysList: string[];
weekDaysList: WeekDay[];
getToday(): Day;
getMonthName(number: number): string;
getMonthNumber(name: string): number;
Expand All @@ -71,7 +81,7 @@ export function utils(locale: string): Utils;

export interface Locale {
months: string[];
weekDays: string[];
weekDays: WeekDay[];
weekStartingIndex: number;
getToday: () => Day;
toNativeDate: () => Date;
Expand Down

0 comments on commit 207c484

Please sign in to comment.