From e0a84ca3cda1186abdcf0261f7160da7b4ffe760 Mon Sep 17 00:00:00 2001 From: Maximiliano Forlenza Date: Wed, 9 Oct 2019 19:17:28 -0300 Subject: [PATCH] fix(datepicker): fix locale --- package-lock.json | 9 ++++----- package.json | 1 + src/components/DateField.js | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5463359..5510b00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@indec/react-commons", - "version": "2.3.0", + "version": "2.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3581,10 +3581,9 @@ } }, "date-fns": { - "version": "2.0.0-beta.2", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.0.0-beta.2.tgz", - "integrity": "sha512-4cicZF707RNerr3/Q3CcdLo+3OHMCfrRXE7h5iFgn7AMvX07sqKLxSf8Yp+WJW5bvKr2cy9/PkctXLv4iFtOaA==", - "dev": true + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.4.1.tgz", + "integrity": "sha512-2RhmH/sjDSCYW2F3ZQxOUx/I7PvzXpi89aQL2d3OAxSTwLx6NilATeUbe0menFE3Lu5lFkOFci36ivimwYHHxw==" }, "debug": { "version": "4.1.1", diff --git a/package.json b/package.json index 6db4be8..c904a70 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "babel-preset-react-app": "^9.0.0", "babel-preset-react-native": "^4.0.1", "coveralls": "^3.0.4", + "date-fns": "^2.4.1", "enzyme": "^3.10.0", "enzyme-adapter-react-16": "^1.14.0", "enzyme-to-json": "^3.3.5", diff --git a/src/components/DateField.js b/src/components/DateField.js index 9e896d1..ddfe2ec 100644 --- a/src/components/DateField.js +++ b/src/components/DateField.js @@ -2,6 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import {Label, FormGroup} from 'reactstrap'; import DatePicker from 'react-datepicker'; +import es from 'date-fns/locale/es'; const handleChange = (date, onChange, currentValue, control) => { if (currentValue === date) { @@ -23,7 +24,7 @@ const DateField = ({ isClearable key="es" id={control} - locale="es" + locale={es} {...{ maxDate, minDate,