All Projects → clauderic → React Infinite Calendar

clauderic / React Infinite Calendar

Licence: mit
✨ Infinite scrolling date-picker built with React, with localization, range selection, themes, keyboard support, and more.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to React Infinite Calendar

Calendar
📆 calendar 日历
Stars: ✭ 119 (-96.89%)
Mutual labels:  date, component, calendar, datepicker
Vue Ctk Date Time Picker
VueJS component to select dates & time, including a range mode
Stars: ✭ 707 (-81.53%)
Mutual labels:  date, calendar, datepicker, range
Rsdayflow
iOS 7+ Calendar (Date Picker) with Infinite Scrolling.
Stars: ✭ 843 (-77.98%)
Mutual labels:  date, calendar, datepicker, infinite-scroll
Vuetify Daterange Picker
The missing date range picker for Vuetify JS you have been looking for.
Stars: ✭ 192 (-94.98%)
Mutual labels:  date, component, datepicker, range
Things Calendar
Simple but elegant datepicker for the web — inspired by Things for mac
Stars: ✭ 165 (-95.69%)
Mutual labels:  date, component, calendar, datepicker
Angular Moment Picker
Angular Moment Picker is an AngularJS directive for date and time picker using Moment.js.
Stars: ✭ 536 (-86%)
Mutual labels:  date, calendar, datepicker
Period
PHP's time range API
Stars: ✭ 616 (-83.91%)
Mutual labels:  date, calendar, range
Zebra datepicker
A super-lightweight, highly configurable, cross-browser date / time picker jQuery plugin
Stars: ✭ 367 (-90.41%)
Mutual labels:  date, calendar, datepicker
Ion2 Calendar
📅 A date picker components for ionic2 /ionic3 / ionic4
Stars: ✭ 537 (-85.97%)
Mutual labels:  calendar, datepicker, range
Persianrangedatepicker
Persian range date picker for android.
Stars: ✭ 48 (-98.75%)
Mutual labels:  date, datepicker, range
Laydate
layDate(日期与时间组件) 是 layui 独立维护的三大组件之一
Stars: ✭ 1,066 (-72.15%)
Mutual labels:  date, calendar, datepicker
Calendarview
An Easy to Use Calendar for iOS (Swift 5.0)
Stars: ✭ 429 (-88.79%)
Mutual labels:  date, calendar, datepicker
Vue Datepicker Ui
Datepicker Component For Vue
Stars: ✭ 252 (-93.42%)
Mutual labels:  component, calendar, datepicker
Lightpick
(deprecated) Check out the new date picker Litepicker
Stars: ✭ 204 (-94.67%)
Mutual labels:  date, datepicker, range
Datepicker
Get a date with JavaScript! A datepicker with no dependencies.
Stars: ✭ 212 (-94.46%)
Mutual labels:  date, calendar, datepicker
React Calendar
A React Native inspired date list renderer
Stars: ✭ 34 (-99.11%)
Mutual labels:  component, calendar, datepicker
react-native-daterange-picker
A React Native component for picking date ranges or single dates.
Stars: ✭ 86 (-97.75%)
Mutual labels:  calendar, datepicker, range
Calendarview
A highly customizable calendar library for Android, powered by RecyclerView.
Stars: ✭ 2,862 (-25.24%)
Mutual labels:  date, calendar, datepicker
vuejs3-datepicker
vue 3 datepicker. supports disabling, highlighting of dates and programmatic access of date.
Stars: ✭ 23 (-99.4%)
Mutual labels:  date, calendar, datepicker
PrimeCalendar
PrimeCalendar provides all of the java.util.Calendar functionalities for Persian, Hijri, and ... dates. It is also possible to convert dates to each other.
Stars: ✭ 45 (-98.82%)
Mutual labels:  date, calendar

React Infinite Calendar

Currently looking for maintainers to help maintain this project, please reach out if you would be interested

npm version downloads license Gitter

Examples available here: http://clauderic.github.io/react-infinite-calendar/

Features

  • Infinite scroll – Just keep scrollin', just keep scrollin'
  • Flexible – Min/max date, disabled dates, disabled days, etc.
  • Extensible – Add date range-selection, multiple date selection, or create your own HOC!
  • Localization and translation – En français, s'il vous plaît!
  • Customizeable – Customize and theme to your heart's content.
  • Year selection – For rapidly jumping from year to year
  • Keyboard support⬆️ ⬇️ ⬆️ ⬇️ ⬅️ ➡️ ⬅️ ➡️ ↩️
  • Events and callbacks – beforeSelect, onSelect, onScroll, etc.
  • Mobile-friendly – Silky smooth scrolling on mobile

Getting Started

Using npm:

npm install react-infinite-calendar --save

ES6, CommonJS, and UMD builds are available with each distribution. For example:

import InfiniteCalendar from 'react-infinite-calendar';
import 'react-infinite-calendar/styles.css'; // Make sure to import the default stylesheet

You can also use a global-friendly UMD build:

<link rel="stylesheet" href="react-infinite-calendar/styles.css">
<script src="react-infinite-calendar/umd/react-infinite-calendar.js"></script>
<script>
var InfiniteCalendar = window.InfiniteCalendar.default;
...
</script>

Usage

Basic Example

import React from 'react';
import { render } from 'react-dom';
import InfiniteCalendar from 'react-infinite-calendar';
import 'react-infinite-calendar/styles.css'; // only needs to be imported once

// Render the Calendar
var today = new Date();
var lastWeek = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 7);

render(
  <InfiniteCalendar
    width={400}
    height={600}
    selected={today}
    disabledDays={[0,6]}
    minDate={lastWeek}
  />,
  document.getElementById('root')
);

For more usage examples, see http://clauderic.github.io/react-infinite-calendar/ or check out some code examples.

Prop Types

Property Type Default Description
selected Date or Boolean new Date() Value of the date that appears to be selected. Set to false if you don't wish to have a date initially selected.
width Number 400 Width of the calendar, in pixels
height Number 600 Height of the calendar, in pixels
min Date new Date(1980, 0, 1) The minimum month that can be scrolled to.
max Date new Date(2050, 11, 31) The maximum month that can be scrolled to.
minDate Date new Date(1980, 0, 1) The minimum date that is selectable.
maxDate Date new Date(2050, 11, 31) The maximum date that is selectable.
disabledDays Array Array of days of the week that should be disabled. For example, to disable Monday and Sunday: [0, 6]
disabledDates Array Array of dates that should be disabled. For example: [new Date(2017, 1, 8), new Date(), new Date(2017, 5, 17)]
display String 'days' Whether to display the years or days view.
displayOptions Object See default displayOptions See display options section for more details.
locale Object See default locale By default, React Infinite Calendar comes with the English locale. You can use this to change the language, or change the first day of the week. See date-fns documentation for more details
theme Object See default theme Basic customization of the colors
className String Optional CSS class name to append to the root InfiniteCalendar element.
onSelect Function Callback invoked after beforeSelect() returns true, but before the state of the calendar updates
onScroll Function Callback invoked when the scroll offset changes. function (scrollTop: number) {}
onScrollEnd Function Callback invoked 150ms after the last onScroll event is triggered. function (scrollTop: number) {}
rowHeight Number 56 Height of each row in the calendar (each week is considered a row)
autoFocus Boolean true Whether the Calendar root should be auto-focused when it mounts. This is useful when keyboardSupport is enabled (the calendar must be focused to listen for keyboard events)
tabIndex Number 1 Tab-index of the calendar

Display Options

Property Type Default Description
layout String 'portrait' Layout of the calendar. Should be one of 'portrait' or 'landscape'
showHeader Boolean true Show/hide the header
shouldHeaderAnimate Boolean true Enable/Disable the header animation
showOverlay Boolean true Show/hide the month overlay when scrolling
showTodayHelper Boolean true Show/hide the floating back to Today helper
showWeekdays Boolean true Show/hide the weekdays in the header
hideYearsOnSelect Boolean true Whether to automatically hide the years view on select.
overscanMonthCount Number 4 Number of months to render above/below the visible months. Tweaking this can help reduce flickering during scrolling on certain browers/devices.
todayHelperRowOffset Number 4 This controls the number of rows to scroll past before the Today helper appears

Example usage of display options:

<InfiniteCalendar
  displayOptions={{
    layout: 'landscape',
    showOverlay: false,
    shouldHeaderAnimate: false
  }}
/>

Dependencies

React Infinite Calendar has very few dependencies. It relies on react-tiny-virtual-list for virtualization and date-fns for handling date manipulation. It also uses recompose for extending the default functionality. It also has the following peerDependencies: react, and react-transition-group.

Reporting Issues

If you find an issue, please report it along with any relevant details to reproduce it. The easiest way to do so is to fork this sandbox on CodeSandbox.

Contributions

Yes please! Feature requests / pull requests are welcome. Learn how to contribute

Have a suggestion or just want to say hello? Come chat on Gitter!

License

react-infinite-calendar is available under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].