# react-day-picker **Repository Path**: mirrors_gbozee/react-day-picker ## Basic Information - **Project Name**: react-day-picker - **Description**: Minimalistic date picker for React and moment.js - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-04-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # react-day-picker
Minimalistic date picker built for [React](facebook.github.io/react/) and [moment.js](http://www.momentjs.com). See a [demo](http://www.gpbl.org/react-day-picker/). ```bash npm install react-day-picker --save ``` [](http://badge.fury.io/js/react-day-picker) ### Use of modifiers This date picker works with modifiers, as in [BEM-like syntax](http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/). You set the modifiers as functions returning `true` or `false`. Modifiers give you a lot of freedom: for example, a `selected` modifier could highlight *a range* of selected days, or a `weekend` modifiers could format the weekend days. ### Styling You need to setup your own CSS. You can start from [this css](example/src/scss/daypicker.scss) as example. ## Usage examples The following component implements the DayPicker and saves the selected day in its own `state`. It also adds the `daypicker__day--today` CSS modifier for today, and a `daypicker__day--selected` CSS modifier to the cell corresponding to the clicked/touched day. ```js var DayPicker = require('react-day-picker'); var moment = require('moment'); function isSameDay(a, b) { return a.startOf('day').isSame(b.startOf('day')); } var MyDatePicker = React.createClass({ handleDayTouchTap(day, modifiers, event) { this.setState({ selectedDay: day }); }, render() { var modifiers = { today: function (day) { // add the `today` modifier for the current day return isSameDay(moment(), day); }, selected: function (day) { // add the `selected` modifier for the selected day return this.state.selectedDay && isSameDay(this.state.selectedDay, day); } }; return (