diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a292bd..d33c83e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,8 +22,8 @@ jobs: uses: actions/cache@v1 with: path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: ${{ runner.os }}-node- + key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.os }}-node-${{ matrix.node-version }}- - name: Cache Gatsby build output uses: actions/cache@v1 diff --git a/src/pages/resume/ResumeItem.jsx b/src/pages/resume/ResumeItem.jsx index 9fb2a4a..71f863e 100644 --- a/src/pages/resume/ResumeItem.jsx +++ b/src/pages/resume/ResumeItem.jsx @@ -40,21 +40,25 @@ function normalizeData(workPlace, eduPlace, award) { ? eduPlace.studyType : null - const { startDate, endDate, date } = workPlace || eduPlace || award + const startDate = award + ? award.date + : (workPlace && workPlace.startDate) || (eduPlace && eduPlace.startDate) - return { title, subTitle, text, startDate, endDate, date } + const endDate = award + ? null + : (workPlace && workPlace.endDate) || (eduPlace && eduPlace.endDate) + + return { title, subTitle, text, startDate, endDate } } export default function ResumeItem({ workPlace, eduPlace, award }) { - const { title, subTitle, text, startDate, endDate, date } = normalizeData( + const { title, subTitle, text, startDate, endDate } = normalizeData( workPlace, eduPlace, award ) - const dateStart = date - ? new Date(date).getFullYear() - : new Date(startDate).getFullYear() + const dateStart = new Date(startDate).getFullYear() const dateEnd = endDate && new Date(endDate).getFullYear() const isSameYear = dateStart === dateEnd @@ -62,11 +66,7 @@ export default function ResumeItem({ workPlace, eduPlace, award }) {