From d4e865860ec52670b0e234b23151e3c6630747eb Mon Sep 17 00:00:00 2001 From: maltempi Date: Fri, 15 Feb 2019 23:43:10 -0200 Subject: [PATCH] Using momentjs method to subtract days --- Packages-react/ohif-viewer/src/sha.js | 2 +- .../ohif-viewer/src/studylist/StudyListWithData.js | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Packages-react/ohif-viewer/src/sha.js b/Packages-react/ohif-viewer/src/sha.js index 0e6f6a765..2b98f735b 100644 --- a/Packages-react/ohif-viewer/src/sha.js +++ b/Packages-react/ohif-viewer/src/sha.js @@ -1 +1 @@ -export default '04dc3724ff959226b3178438e9bf6096fc923ef3'; +export default '94ab9ff791bb7d2ad2745df8ff2c994317788751'; diff --git a/Packages-react/ohif-viewer/src/studylist/StudyListWithData.js b/Packages-react/ohif-viewer/src/studylist/StudyListWithData.js index acf583da5..e8817c66f 100644 --- a/Packages-react/ohif-viewer/src/studylist/StudyListWithData.js +++ b/Packages-react/ohif-viewer/src/studylist/StudyListWithData.js @@ -6,11 +6,6 @@ import { StudyList } from 'react-viewerbase'; import ConnectedHeader from '../connectedComponents/ConnectedHeader.js'; import moment from 'moment'; -const subtractDaysFromDate = (date, days) => { - date.setDate(date.getDate() - days); - return date; -}; - class StudyListWithData extends Component { state = { searchData: {}, @@ -30,10 +25,9 @@ class StudyListWithData extends Component { static defaultSort = { field: 'patientName', order: 'desc' }; static studyListDateFilterNumDays = 25000; // TODO: put this in the settings - static defaultStudyDateFrom = subtractDaysFromDate( - new Date(), - StudyListWithData.studyListDateFilterNumDays - ); + static defaultStudyDateFrom = moment() + .subtract(StudyListWithData.studyListDateFilterNumDays, 'days') + .toDate(); static defaultStudyDateTo = new Date(); componentDidMount() {