Skip to content

Commit

Permalink
Merge pull request #52 from indec-it/fix/datepicker
Browse files Browse the repository at this point in the history
fix(dateField): fix when compare dates
  • Loading branch information
maximilianoforlenza authored Oct 4, 2019
2 parents 43bee59 + cfd498c commit b4d40fe
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/components/DateField.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ import PropTypes from 'prop-types';
import {Label, FormGroup} from 'reactstrap';
import DatePicker from 'react-datepicker';

import {DateUtilsService} from '../services';

const handleChange = (date, onChange, currentValue, control) => {
const value = DateUtilsService.formatToISOString(date);
if (currentValue === value) {
if (currentValue === date) {
return;
}
onChange({target: {value, id: control}});
onChange({target: {value: date, id: control}});
};

const DateField = ({
Expand Down

0 comments on commit b4d40fe

Please sign in to comment.