Skip to content

Commit 9989400

Browse files
authored
Merge pull request #485 from hypeserver/prepare-release-1.2.0
Release 1.2.0
2 parents bc440af + 3a6ca4e commit 9989400

File tree

5 files changed

+38
-15
lines changed

5 files changed

+38
-15
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @burakcan @mkg0 @kamyar

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
8+
## 1.2.0
9+
10+
### Added
11+
- `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)
12+
13+
14+
## 1.1.4
15+
16+
### Fixed
17+
- #356: Use babel-plugin-date-fns to reduce bundle size
18+
- #373, #415, #416: Add missing aria labels
19+
20+
721
## 1.0.0
822
### Changed
923
- 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))

README.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,17 @@ If you prefer, you can overwrite calendar sizes with `calendarWidth`/`calendarHe
188188
```
189189

190190

191-
TODOs
191+
### Release workflow
192+
- Merge everything that needs to be in the release to master
193+
- Open a new release PR than:
194+
- bumps version to appropriate one <new_version>
195+
- Update CHANGELOG.md
196+
- Make sure the demo and important features are working as expected
197+
- After merging, tag the master commit with `release/<new_version>` and let Github Action handle publishing
198+
- = Profit 🙈
199+
200+
### TODOs
192201

193202
- Make mobile friendly (integrate tap and swipe actions)
194-
- Add complex booking customization example with exposed dayRenderer prop
195203
- Add tests
196204
- Improve documentation

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-date-range",
3-
"version": "1.1.4",
3+
"version": "1.2.0",
44
"description": "A React component for choosing dates and date ranges.",
55
"main": "dist/index.js",
66
"scripts": {

src/components/DateRangePicker/README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -91,25 +91,25 @@ const [state, setState] = useState({
9191
import { addDays } from 'date-fns';
9292
import { useState } from 'react';
9393

94-
const [state, setState] = useState([
95-
{
94+
const [state, setState] = useState({
95+
selection1: {
9696
startDate: addDays(new Date(), -6),
9797
endDate: new Date(),
9898
key: 'selection1'
9999
},
100-
{
100+
selection2: {
101101
startDate: addDays(new Date(), 1),
102102
endDate: addDays(new Date(), 7),
103103
key: 'selection2'
104104
}
105-
]);
105+
});
106106

107107
<DateRangePicker
108-
onChange={item => setState([item.selection])}
108+
onChange={item => setState({ ...state, ...item })}
109109
showSelectionPreview={true}
110110
moveRangeOnFirstSelection={false}
111111
months={2}
112-
ranges={state}
112+
ranges={[state.selection1, state.selection2]}
113113
direction="horizontal"
114114
ariaLabels={{
115115
dateInput: {
@@ -131,18 +131,18 @@ Show orange dot only for weekend
131131
import { addDays, format, isWeekend } from 'date-fns';
132132
import { useState } from 'react';
133133

134-
const [state, setState] = useState([
135-
{
134+
const [state, setState] = useState({
135+
selection1: {
136136
startDate: addDays(new Date(), -6),
137137
endDate: new Date(),
138138
key: 'selection1'
139139
},
140-
{
140+
selection2: {
141141
startDate: addDays(new Date(), 1),
142142
endDate: addDays(new Date(), 7),
143143
key: 'selection2'
144144
}
145-
]);
145+
});
146146

147147
function customDayContent(day) {
148148
extraDot = null;
@@ -170,11 +170,11 @@ function customDayContent(day) {
170170
}
171171

172172
<DateRangePicker
173-
onChange={item => setState([item.selection])}
173+
onChange={item => setState({ ...state, ...item })}
174174
showSelectionPreview={true}
175175
moveRangeOnFirstSelection={false}
176176
months={2}
177-
ranges={state}
177+
ranges={[state.selection1, state.selection2]}
178178
direction="horizontal"
179179
dayContentRenderer={customDayContent}
180180
ariaLabels={{

0 commit comments

Comments
 (0)