Skip to content

Commit

Permalink
Merge pull request #267 from digipolisantwerp/feature/locale-document…
Browse files Browse the repository at this point in the history
…ation

Added locale documentation
  • Loading branch information
TriangleJuice authored Dec 24, 2021
2 parents 1708faa + 151a3e6 commit 5eecf73
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
7 changes: 7 additions & 0 deletions packages/calendar/Readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
```
<Calendar
locale={"nl"}
format={"DD/MM/YYYY"}
onChange={(date) => console.log('date is ' + date)}
/>
```

If you want to use another locale (like e.g. Dutch) you have to manually import it. You can also choose to load more locales and define the right one via the `locale` prop. If no locales are defined React will fall back to English.

```js static
import 'moment/locale/nl';
```
14 changes: 10 additions & 4 deletions packages/form/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,18 @@ const optionsDistrict = [

### Datepicker

If you want to use another locale (like e.g. Dutch) you have to manually import it. You can also choose to load more locales and define the right one via the `locale` prop. If no locales are defined React will fall back to English.

```js static
import 'moment/locale/nl';
```

```
const Datepicker = require('./src').Datepicker;
<div>
<Datepicker
locale={"en"}
locale={"nl"}
id={"datepicker-id-1"}
name={"datepicker-name"}
label={"Datepicker with input mask"}
Expand All @@ -566,7 +572,7 @@ const Datepicker = require('./src').Datepicker;
<br />
<Datepicker
locale={"en"}
locale={"nl"}
id={"datepicker-id-2"}
name={"datepicker-name"}
label={"Datepicker without input mask"}
Expand All @@ -583,7 +589,7 @@ const Datepicker = require('./src').Datepicker;
<Datepicker
size="small"
locale={"en"}
locale={"nl"}
id={"datepicker-id-3"}
name={"datepicker-name"}
label={"Datepicker without input mask and small"}
Expand All @@ -599,7 +605,7 @@ const Datepicker = require('./src').Datepicker;
<Datepicker
size="large"
locale={"en"}
locale={"nl"}
id={"datepicker-id-4"}
name={"datepicker-name"}
label={"Datepicker without input mask and small"}
Expand Down
2 changes: 1 addition & 1 deletion packages/tabs/src/Tabs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow
import React from 'react';
import classNames from 'classnames';
import Link from '../../link';
import Link from '../../link/src/Link';

type Props = {
align?: 'left' | 'right' | 'center',
Expand Down

0 comments on commit 5eecf73

Please sign in to comment.