Skip to content

Commit

Permalink
Merge pull request #346 from onurkerimov/master
Browse files Browse the repository at this point in the history
Change
  • Loading branch information
onurkerimov committed Feb 20, 2020
2 parents d8e88db + 1c61f59 commit 8a895f4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
16 changes: 13 additions & 3 deletions CHANGELOG.md
Expand Up @@ -4,9 +4,9 @@ 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.1.0
## 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, 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/))
- 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))

```jsx
<Calendar
Expand All @@ -20,12 +20,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
- `weekStartsOn` prop: You can set the week start day. (Number, 0 - Sunday, 1 - Monday etc.) If not specified, gets the week start day from your locale.

- `weekdayDisplayFormat` and `dayDisplayFormat` props: For being able to use different versions of date-fns
- `weekdayDisplayFormat`, `dayDisplayFormat` and `monthDisplayFormat` props: For being able to use different versions of date-fns

- `startDatePlaceholder` and `endDatePlaceholder` props: You can set different placeholders for Date inputs. If not set, falls back to 'Early' and 'Continuous'.

- `fixedHeight` prop: Set this to `true` to prevent height change while selecting different months. Since some months require less than 6 lines to show, by setting this prop, you can force 6 lines for all months.

- `editableDateInputs` prop: Set this to `true` to make the inputs editable. Falls back to false.

- `DateInput` and `InputRangeField` are exported as dedicated components.


### Fixed
- Works with React 16, without warnings (Deprecated methods are removed: componentWillReceiveProps )
- IE11 Bug where the last day of each week is not shown.
- Now infinite scroll mode works as expected.

## 1.0.0 beta

### Changed
Expand Down
22 changes: 14 additions & 8 deletions README.md
Expand Up @@ -96,7 +96,7 @@ class MyComponent extends Component {

Property | type | Default Value | Description
-------------------------------------|-----------|------------------|-----------------------------------------------------------------
locale | Object | enUS from locale | you can view full list from [here](https://github.com/Adphorus/react-date-range/tree/next/src/locale/index.js). Locales directly exported from [`date-fns/locales`](https://date-fns.org/v2.0.0-alpha.7/docs/I18n#supported-languages).
locale | Object | enUS from locale | you can view full list from [here](https://github.com/Adphorus/react-date-range/tree/next/src/locale/index.js). Locales directly exported from [`date-fns/locales`](https://date-fns.org/docs/I18n#supported-languages).
className | String | | wrapper classname
months | Number | 1 | rendered month count
showSelectionPreview | Boolean | true | show preview on focused/hovered dates
Expand All @@ -107,7 +107,7 @@ minDate | Date | | defines mi
maxDate | Date | | defines maximum date. Disabled later dates
direction | String | 'vertical' | direction of calendar months. can be `vertical` or `horizontal`
disabledDates | Date[] | [] | dates that are disabled
scroll | Object | { enabled: false }| infinite scroll behaviour configuration. Check out [Infinite Scroll](#infinite-scrolled-mode) section
scroll | Object | { enabled: false }| infinite scroll behaviour configuration. Check out [Infinite Scroll](#infinite-scrolled-mode) section
showMonthArrow | Boolean | true | show/hide month arrow button
navigatorRenderer | Func | | renderer for focused date navigation area. fn(currentFocusedDate: Date, changeShownDate: func, props: object)
ranges | *Object[] | [] | Defines ranges. array of range object
Expand All @@ -121,16 +121,22 @@ onShownDateChange(DateRange,Calendar)| Function | | Callback f
initialFocusedRange(DateRange) | Object | | Initial value for focused range. See `focusedRange` for usage.
focusedRange(DateRange) | Object | | It defines which range and step are focused. Common initial value is `[0, 0]`; first value is index of ranges, second one is which step on date range(startDate or endDate).
onRangeFocusChange(DateRange) | Object | | Callback function for focus changes
preview(DateRange) | Object | | displays a preview range and overwrite DateRange's default preview. Expected shape: `{ startDate: Date, endDate: Date, color: String }`
preview(DateRange) | Object | | displays a preview range and overwrite DateRange's default preview. Expected shape: `{ startDate: Date, endDate: Date, color: String }`
showPreview(DateRange) | bool | true | visibility of preview
editableDateInputs(Calendar) | bool | false | whether dates can be edited in the Calendar's input fields
dragSelectionEnabled(Calendar) | bool | true | whether dates can be selected via drag n drop
onPreviewChange(DateRange) | Object | | Callback function for preview changes
dateDisplayFormat(DateRange) | String | `MMM D, YYYY` | selected range preview formatter. Check out [date-fns's format option](https://date-fns.org/v2.0.0-alpha.7/docs/format)
renderStaticRangeLabel(`DefinedRange`)| Function | | Callback function to be triggered for the static range configurations that have `hasCustomRendering: true` on them. Instead of rendering `staticRange.label`, return value of this callback will be rendered.
staticRanges(`DefinedRange`, `DateRangePicker`) | Array | [default preDefined ranges](https://github.com/Adphorus/react-date-range/blob/master/src/defaultRanges.js) | -
inputRanges(`DefinedRange`, `DateRangePicker`) | Array | [default input ranges](https://github.com/Adphorus/react-date-range/blob/master/src/defaultRanges.js) | -

dateDisplayFormat | String | `MMM d, yyyy` | selected range preview formatter. Check out [date-fns's format option](https://date-fns.org/docs/format)
dayDisplayFormat | String | `d` | selected range preview formatter. Check out [date-fns's format option](https://date-fns.org/docs/format)
weekdayDisplayFormat | String | `E` | selected range preview formatter. Check out [date-fns's format option](https://date-fns.org/docs/format)
monthDisplayFormat | String | `MMM yyyy` | selected range preview formatter. Check out [date-fns's format option](https://date-fns.org/docs/format)
weekStartsOn | Number | | Whether the week start day that comes from the locale will be overriden. Default value comes from your locale, if no local is specified, note that default locale is enUS
startDatePlaceholder | String | `Early` | Start Date Placeholder
endDatePlaceholder | String | `Continuous` | End Date Placeholder
fixedHeight | Boolean | false | Since some months require less than 6 lines to show, by setting this prop, you can force 6 lines for all months.
renderStaticRangeLabel(`DefinedRange`)| Function | | Callback function to be triggered for the static range configurations that have `hasCustomRendering: true` on them. Instead of rendering `staticRange.label`, return value of this callback will be rendered.
staticRanges(`DefinedRange`, `DateRangePicker`) | Array | [default preDefined ranges](https://github.com/Adphorus/react-date-range/blob/master/src/defaultRanges.js) | -
inputRanges(`DefinedRange`, `DateRangePicker`) | Array | [default input ranges](https://github.com/Adphorus/react-date-range/blob/master/src/defaultRanges.js) | -

*shape of range:
```js
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "react-date-range",
"version": "1.1.0",
"version": "1.0.0",
"description": "A React component for choosing dates and date ranges.",
"main": "dist/index.js",
"scripts": {
Expand Down

0 comments on commit 8a895f4

Please sign in to comment.