forked from DebaucheryLibrarian/traxxx
Hiding scenes with missing dates from network overview. Using computed effective date column.
This commit is contained in:
@@ -3,30 +3,6 @@ import dayjs from 'dayjs';
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
||||
const dateRanges = {
|
||||
latest: () => ({
|
||||
after: '1900-01-01',
|
||||
before: dayjs.utc().toDate(),
|
||||
orderBy: ['DATE_DESC', 'CREATED_AT_DESC'],
|
||||
}),
|
||||
upcoming: () => ({
|
||||
after: dayjs.utc().toDate(),
|
||||
before: '2100-01-01',
|
||||
orderBy: ['DATE_ASC', 'CREATED_AT_ASC'],
|
||||
}),
|
||||
new: () => ({
|
||||
after: '1900-01-01 00:00:00',
|
||||
before: '2100-01-01',
|
||||
orderBy: ['CREATED_AT_DESC', 'DATE_ASC'],
|
||||
}),
|
||||
all: () => ({
|
||||
after: '1900-01-01',
|
||||
before: '2100-01-01',
|
||||
orderBy: ['DATE_DESC', 'CREATED_AT_DESC'],
|
||||
}),
|
||||
};
|
||||
|
||||
/* requires PostgreSQL 12.x> not available in production yet
|
||||
const dateRanges = {
|
||||
latest: () => ({
|
||||
after: '1900-01-01',
|
||||
@@ -49,7 +25,6 @@ const dateRanges = {
|
||||
orderBy: ['EFFECTIVE_DATE_DESC'],
|
||||
}),
|
||||
};
|
||||
*/
|
||||
|
||||
function getDateRange(range) {
|
||||
return (dateRanges[range] || dateRanges.all)();
|
||||
|
||||
Reference in New Issue
Block a user