fix daterange presets
This commit is contained in:
parent
8f284aafac
commit
92923789e5
@ -62,8 +62,8 @@ const DateRange = props => {
|
|||||||
className={`m-0 py-2 px-3 bg-primary-main border-0 rounded text-white text-base transition duration-300 hover:opacity-80`}
|
className={`m-0 py-2 px-3 bg-primary-main border-0 rounded text-white text-base transition duration-300 hover:opacity-80`}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
onChange({
|
onChange({
|
||||||
startDate: start,
|
startDate: start ? start.format('YYYYMMDD') : undefined,
|
||||||
endDate: end,
|
endDate: end ? end.format('YYYYMMDD') : undefined,
|
||||||
preset: true,
|
preset: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,11 +56,13 @@ function StudyListContainer({ history, data: studies }) {
|
|||||||
// TODO: nesting/recursion?
|
// TODO: nesting/recursion?
|
||||||
// TODO: modalities array
|
// TODO: modalities array
|
||||||
if (key === 'studyDate') {
|
if (key === 'studyDate') {
|
||||||
console.log(currValue)
|
if (
|
||||||
if (defaultValue.startDate !== currValue.startDate) {
|
currValue.startDate &&
|
||||||
|
defaultValue.startDate !== currValue.startDate
|
||||||
|
) {
|
||||||
queryString.startDate = currValue.startDate;
|
queryString.startDate = currValue.startDate;
|
||||||
}
|
}
|
||||||
if (defaultValue.endDate !== currValue.endDate) {
|
if (currValue.endDate && defaultValue.endDate !== currValue.endDate) {
|
||||||
queryString.endDate = currValue.endDate;
|
queryString.endDate = currValue.endDate;
|
||||||
}
|
}
|
||||||
} else if (currValue !== defaultValue) {
|
} else if (currValue !== defaultValue) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user