Skip to content

Commit

Permalink
Solution to issue Hacker0x01#1337 (Hacker0x01#1541)
Browse files Browse the repository at this point in the history
* Added a prop and logic for keeping the currently displayed months the same when working with a multi-month inline calendar.

* Added tests to prove the added functionality.

* Removed the boolean value that caused the Travis CI build to fail.

* Removed duplicate default props from calendar.jsx.

* Fixed a test that fails when it is December so it will no longer fail for the entirety of the month.
  • Loading branch information
CalebKAston authored and martijnrusschen committed Jan 19, 2019
1 parent 20bd487 commit 23a0c99
Show file tree
Hide file tree
Showing 33 changed files with 35,611 additions and 7,733 deletions.
15 changes: 9 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# How to contribute

Thanks for taking your time to read this. We're thrilled you're reading this because we the help from the community to keep improving this project.

## Testing

We have a handful of Cucumber features, but most of our testbed consists of RSpec examples. Please write RSpec examples for new code you create.

## Submitting changes

Please send a [GitHub Pull Request](https://github.com/Hacker0x01/react-datepicker/pull/new/master) with a clear list of what you've done (read more about [pull requests](https://help.github.com/articles/about-pull-requests/)). When you send a pull request, we will love you forever if you include a test to cover your changes. We can always use more test coverage.
Always write a clear log message for your commits. One-line messages are fine for small changes, but bigger changes should look like this:
$ git commit -m "A summary of the commit
>
> A paragraph describing what changed and its impact."
$ git commit -m "A summary of the commit > > A paragraph describing what changed and its impact."

## Coding conventions

Start reading our code, and you'll get the hang of it. We optimize for readability:
* We use prettier for code styling. Don't worry about tabs vs spaces, or how to indent your code.
* We use ESlint for all other coding standards. We try to be consistent and helpful.
* This is open source software. Consider the people who will read your code, and make it look nice for them. It's sort of like driving a car: Perhaps you love doing donuts when you're alone, but with passengers, the goal is to make the ride as smooth as possible.

- We use prettier for code styling. Don't worry about tabs vs spaces, or how to indent your code.
- We use ESlint for all other coding standards. We try to be consistent and helpful.
- This is open source software. Consider the people who will read your code, and make it look nice for them. It's sort of like driving a car: Perhaps you love doing donuts when you're alone, but with passengers, the goal is to make the ride as smooth as possible.
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,20 @@ More examples of how to use the time picker are given on the [main website](http

The date picker relies on [date-fns internationalization](https://date-fns.org/v2.0.0-alpha.18/docs/I18n) to localize its display components. By default, the date picker will use the locale globally set, which is English. Provided are 3 helper methods to set the locale:

* **registerLocale** (string, object): loads an imported locale object from date-fns
* **setDefaultLocale** (string): sets a registered locale as the default for all datepicker instances
* **getDefaultLocale**: returns a string showing the currently set default locale
- **registerLocale** (string, object): loads an imported locale object from date-fns
- **setDefaultLocale** (string): sets a registered locale as the default for all datepicker instances
- **getDefaultLocale**: returns a string showing the currently set default locale

To load an alternate locale:

* Import the helper methods you need: `import { registerLocale, setDefaultLocale } from DatePicker;`
* Import the locale from date-fns: `import fi from 'date-fns/locale/fi';`
* Register the locale: `registerLocale('fi', fi);`
- Import the helper methods you need: `import { registerLocale, setDefaultLocale } from DatePicker;`
- Import the locale from date-fns: `import fi from 'date-fns/locale/fi';`
- Register the locale: `registerLocale('fi', fi);`

Locales can be changed in the following ways:

* **Globally** - `setDefaultLocale('fi');`
* **Picker-specific** by providing the `locale` prop - `<DatePicker locale='fi' ... />`
- **Globally** - `setDefaultLocale('fi');`
- **Picker-specific** by providing the `locale` prop - `<DatePicker locale='fi' ... />`

## Compatibility

Expand All @@ -123,11 +123,11 @@ We're always trying to stay compatible with the latest version of React. We can'

Latest compatible versions:

* React 15.5 or newer: All above React-datepicker v.0.40.0
* React 15.4.1: needs React-datepicker v0.40.0, newer won't work (due to react-onclickoutside dependencies)
* React 0.14 or newer: All above React-datepicker v0.13.0
* React 0.13: React-datepicker v0.13.0
* pre React 0.13: React-datepicker v0.6.2
- React 15.5 or newer: All above React-datepicker v.0.40.0
- React 15.4.1: needs React-datepicker v0.40.0, newer won't work (due to react-onclickoutside dependencies)
- React 0.14 or newer: All above React-datepicker v0.13.0
- React 0.13: React-datepicker v0.13.0
- pre React 0.13: React-datepicker v0.6.2

### Moment.js

Expand All @@ -153,15 +153,15 @@ The examples are hosted within the docs folder and are ran in the simple app tha

### Keyboard support

* _Left_: Move to the previous day.
* _Right_: Move to the next day.
* _Up_: Move to the previous week.
* _Down_: Move to the next week.
* _PgUp_: Move to the previous month.
* _PgDn_: Move to the next month.
* _Home_: Move to the previous year.
* _End_: Move to the next year.
* _Enter/Esc/Tab_: close the calendar. (Enter & Esc calls preventDefault)
- _Left_: Move to the previous day.
- _Right_: Move to the next day.
- _Up_: Move to the previous week.
- _Down_: Move to the next week.
- _PgUp_: Move to the previous month.
- _PgDn_: Move to the next month.
- _Home_: Move to the previous year.
- _End_: Move to the next year.
- _Enter/Esc/Tab_: close the calendar. (Enter & Esc calls preventDefault)

## License

Expand Down
Loading

0 comments on commit 23a0c99

Please sign in to comment.