fix: include the until date day on range selection
This commit is contained in:
parent
9ea83603e7
commit
321fc642a4
1 changed files with 2 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import { makeStyles } from '@material-ui/core/styles'
|
import { makeStyles } from '@material-ui/core/styles'
|
||||||
import classnames from 'classnames'
|
import classnames from 'classnames'
|
||||||
|
import moment from 'moment'
|
||||||
import React, { useState, useEffect } from 'react'
|
import React, { useState, useEffect } from 'react'
|
||||||
|
|
||||||
import Calendar from './Calendar'
|
import Calendar from './Calendar'
|
||||||
|
|
@ -37,7 +38,7 @@ const DateRangePicker = ({ minDate, maxDate, className, onRangeChange }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (from && !to && day.isSameOrAfter(from, 'day')) {
|
if (from && !to && day.isSameOrAfter(from, 'day')) {
|
||||||
setTo(day)
|
setTo(moment(day.toDate().setHours(23, 59, 59, 999)))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue