From 029099d4a51168ddb59dc73f60c470e86d1a6924 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Mon, 28 Dec 2020 01:33:09 +0100 Subject: [PATCH] Added fallback createdAt date to date range. --- assets/js/get-date-range.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/get-date-range.js b/assets/js/get-date-range.js index 83806344..785fd23b 100644 --- a/assets/js/get-date-range.js +++ b/assets/js/get-date-range.js @@ -7,12 +7,12 @@ const dateRanges = { latest: () => ({ after: '1900-01-01', before: dayjs.utc().toDate(), - orderBy: 'DATE_DESC', + orderBy: ['DATE_DESC', 'CREATED_AT_DESC'], }), upcoming: () => ({ after: dayjs.utc().toDate(), before: '2100-01-01', - orderBy: 'DATE_ASC', + orderBy: ['DATE_ASC', 'CREATED_AT_ASC'], }), new: () => ({ after: '1900-01-01 00:00:00', @@ -22,7 +22,7 @@ const dateRanges = { all: () => ({ after: '1900-01-01', before: '2100-01-01', - orderBy: 'DATE_DESC', + orderBy: ['DATE_DESC', 'CREATED_AT_DESC'], }), };