From 3cac81ecbe0bf162103284a2ba4870bcc10e0fd1 Mon Sep 17 00:00:00 2001 From: Kamyar Ghasemlou Date: Thu, 10 Jun 2021 17:20:54 +0200 Subject: [PATCH 1/4] changes necessary for 1.2.0 version --- CHANGELOG.md | 14 ++++++++++++++ README.md | 1 - package.json | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) 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..0d59a14bb 100644 --- a/README.md +++ b/README.md @@ -191,6 +191,5 @@ If you prefer, you can overwrite calendar sizes with `calendarWidth`/`calendarHe 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": { From 763190ece1d720520c7c4073c175c97570f66c8f Mon Sep 17 00:00:00 2001 From: Kamyar Ghasemlou Date: Thu, 10 Jun 2021 17:22:39 +0200 Subject: [PATCH 2/4] add codeowners --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS 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 From d43dc015ae93567c034fb5d364d981a1a5b44a5d Mon Sep 17 00:00:00 2001 From: Kamyar Ghasemlou Date: Thu, 10 Jun 2021 17:29:32 +0200 Subject: [PATCH 3/4] update readme on how to publish new versions --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d59a14bb..a61e31996 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,16 @@ 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 tests From 3a6ca4eb6d9af1b161eddc509884fc59b1409bf2 Mon Sep 17 00:00:00 2001 From: Kamyar Ghasemlou Date: Thu, 10 Jun 2021 19:14:07 +0200 Subject: [PATCH 4/4] hotfix demo not working --- src/components/DateRangePicker/README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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={{