diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..9b6d60fc5 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @burakcan @mkg0 @kamyar diff --git a/CHANGELOG.md b/CHANGELOG.md index 10f0c2fb3..be4c43188 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## 1.2.0 + +### Added +- `dayContentRenderer` prop: You can control how each date cell is rendered be passing this function that excepts a date and returns what need to be rendered (#242, #384, #476) + + +## 1.1.4 + +### Fixed +- #356: Use babel-plugin-date-fns to reduce bundle size +- #373, #415, #416: Add missing aria labels + + ## 1.0.0 ### Changed - BREAKING: `date-fns` is now loaded as a peerDependency. You can use this plugin with your own project's `date-fns` version. However if you want to keep using date-fns versions older than 2.0.0, (minimum version is 2.0.0-alpha.1) you need to pass the following props to your component. ([See the reason here](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg/), also see [this table](https://date-fns.org/docs/format)) diff --git a/README.md b/README.md index e373972d6..a61e31996 100644 --- a/README.md +++ b/README.md @@ -188,9 +188,17 @@ If you prefer, you can overwrite calendar sizes with `calendarWidth`/`calendarHe ``` -TODOs +### Release workflow +- Merge everything that needs to be in the release to master +- Open a new release PR than: + - bumps version to appropriate one + - Update CHANGELOG.md +- Make sure the demo and important features are working as expected +- After merging, tag the master commit with `release/` and let Github Action handle publishing +- = Profit 🙈 + +### TODOs - Make mobile friendly (integrate tap and swipe actions) -- Add complex booking customization example with exposed dayRenderer prop - Add tests - Improve documentation diff --git a/package.json b/package.json index 97c5b3b9f..90c9f9ee2 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-date-range", - "version": "1.1.4", + "version": "1.2.0", "description": "A React component for choosing dates and date ranges.", "main": "dist/index.js", "scripts": { diff --git a/src/components/DateRangePicker/README.md b/src/components/DateRangePicker/README.md index 0e9a3578e..248e40d81 100644 --- a/src/components/DateRangePicker/README.md +++ b/src/components/DateRangePicker/README.md @@ -91,25 +91,25 @@ const [state, setState] = useState({ import { addDays } from 'date-fns'; import { useState } from 'react'; -const [state, setState] = useState([ - { +const [state, setState] = useState({ + selection1: { startDate: addDays(new Date(), -6), endDate: new Date(), key: 'selection1' }, - { + selection2: { startDate: addDays(new Date(), 1), endDate: addDays(new Date(), 7), key: 'selection2' } -]); +}); setState([item.selection])} + onChange={item => setState({ ...state, ...item })} showSelectionPreview={true} moveRangeOnFirstSelection={false} months={2} - ranges={state} + ranges={[state.selection1, state.selection2]} direction="horizontal" ariaLabels={{ dateInput: { @@ -131,18 +131,18 @@ Show orange dot only for weekend import { addDays, format, isWeekend } from 'date-fns'; import { useState } from 'react'; -const [state, setState] = useState([ - { +const [state, setState] = useState({ + selection1: { startDate: addDays(new Date(), -6), endDate: new Date(), key: 'selection1' }, - { + selection2: { startDate: addDays(new Date(), 1), endDate: addDays(new Date(), 7), key: 'selection2' } -]); +}); function customDayContent(day) { extraDot = null; @@ -170,11 +170,11 @@ function customDayContent(day) { } setState([item.selection])} + onChange={item => setState({ ...state, ...item })} showSelectionPreview={true} moveRangeOnFirstSelection={false} months={2} - ranges={state} + ranges={[state.selection1, state.selection2]} direction="horizontal" dayContentRenderer={customDayContent} ariaLabels={{