Skip to content

Commit 7994644

Browse files
committed
updated readme
1 parent 478dd76 commit 7994644

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,20 @@ Event handler callbacks are called with `calendar objects` like this:
3636

3737
Parameters that require date types accept YYYY-MM-DD formated datestrings (in gregorian), JavaScript date objects, `calendar objects` and UTC timestamps.
3838

39-
Calendars can be localized by adding custom locales to `LocaleConfig` object:
39+
Calendars can be localized by adding custom locales using `Moment's i18n` object:
4040

4141
```javascript
42-
import {LocaleConfig} from 'react-native-calendars';
43-
44-
LocaleConfig.locales['fr'] = {
45-
monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
46-
monthNamesShort: ['Janv.','Févr.','Mars','Avril','Mai','Juin','Juil.','Août','Sept.','Oct.','Nov.','Déc.'],
47-
dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
48-
dayNamesShort: ['Dim.','Lun.','Mar.','Mer.','Jeu.','Ven.','Sam.']
49-
};
50-
51-
LocaleConfig.defaultLocale = 'fr';
42+
import Moment from 'moment';
43+
44+
Moment.locales('fr', {
45+
months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
46+
monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
47+
monthsParseExact : true,
48+
weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
49+
weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
50+
weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),
51+
weekdaysParseExact : true,
52+
});
5253
```
5354

5455
### Calendar

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-general-calendars",
3-
"version": "1.2.2",
3+
"version": "1.2.3",
44
"description": "React Native Calendar Components with support of Gregorian & Jalaali Calendars",
55
"main": "src/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)