diff --git a/src/index.jsx b/src/index.jsx index 6839710e2..5168b25d3 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -692,10 +692,12 @@ export default class DatePicker extends React.Component { } else if (hasStartRange) { if (changedDate === null) { onChange([null, null], event); - } else if (isDateBefore(changedDate, startDate) && swapRange) { - onChange([changedDate, startDate], event); } else if (isDateBefore(changedDate, startDate)) { - onChange([changedDate, null], event); + if (swapRange) { + onChange([changedDate, startDate], event); + } else { + onChange([changedDate, null], event); + } } else { onChange([startDate, changedDate], event); }