Skip to content

Commit

Permalink
feat: Internationalization (add daysOfWeek and monthsOfYear props)
Browse files Browse the repository at this point in the history
  • Loading branch information
6eDesign committed Nov 15, 2019
1 parent 2041958 commit 20c6d5a
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 55 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ prop name | type | default
`dateChosen` | `boolean` | `false`
`selectableCallback` | `function` | `null`
`format` | `string` \| `function` | `'#{m}/#{d}/#{Y}'`
`daysOfWeek` | `array` | En-US Locale (see below)
`monthsOfYear` | `array` | En-US Locale (see below)

### `start` and `end`
These properties set the minimum and maximum dates that will be rendered by this calendar. It is **highly** recommended that you do not leave these as their defaults and supply values which suit your application's needs.
Expand All @@ -35,6 +37,35 @@ Provide a function which accepts a date and returns a boolean determining whethe
### `format`
Date formatting uses [`timeUtils`] formatting (MM/DD/YYYY by default). If you would like to use a different formatting library, supply a function which accepts a date and returns a string.

### `daysOfWeek` and `monthsOfYear`
These two properties are used to internationalize the calendar. The default values are:

```javascript
export let daysOfWeek = [
['Sunday', 'Sun'],
['Monday', 'Mon'],
['Tuesday', 'Tue'],
['Wednesday', 'Wed'],
['Thursday', 'Thu'],
['Friday', 'Fri'],
['Saturday', 'Sat']
];
export let monthsOfYear = [
['January', 'Jan'],
['February', 'Feb'],
['March', 'Mar'],
['April', 'Apr'],
['May', 'May'],
['June', 'Jun'],
['July', 'Jul'],
['August', 'Aug'],
['September', 'Sep'],
['October', 'Oct'],
['November', 'Nov'],
['December', 'Dec']
];
```

### Kitchen Sink Example:
```html
<Datepicker
Expand Down
2 changes: 1 addition & 1 deletion docs/bundle.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 20c6d5a

Please sign in to comment.