diff --git a/platform/ui/src/components/DateRange/DateRange.jsx b/platform/ui/src/components/DateRange/DateRange.jsx index 3b9f8cce7..a5996d4f6 100644 --- a/platform/ui/src/components/DateRange/DateRange.jsx +++ b/platform/ui/src/components/DateRange/DateRange.jsx @@ -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`} onClick={() => onChange({ - startDate: start, - endDate: end, + startDate: start ? start.format('YYYYMMDD') : undefined, + endDate: end ? end.format('YYYYMMDD') : undefined, preset: true, }) } diff --git a/platform/viewer/src/routes/StudyListContainer/StudyListContainer.jsx b/platform/viewer/src/routes/StudyListContainer/StudyListContainer.jsx index 08e1c729c..49d3a7954 100644 --- a/platform/viewer/src/routes/StudyListContainer/StudyListContainer.jsx +++ b/platform/viewer/src/routes/StudyListContainer/StudyListContainer.jsx @@ -56,11 +56,13 @@ function StudyListContainer({ history, data: studies }) { // TODO: nesting/recursion? // TODO: modalities array if (key === 'studyDate') { - console.log(currValue) - if (defaultValue.startDate !== currValue.startDate) { + if ( + currValue.startDate && + defaultValue.startDate !== currValue.startDate + ) { queryString.startDate = currValue.startDate; } - if (defaultValue.endDate !== currValue.endDate) { + if (currValue.endDate && defaultValue.endDate !== currValue.endDate) { queryString.endDate = currValue.endDate; } } else if (currValue !== defaultValue) {