|
|
|
@ -241,13 +241,69 @@ export const comparisonOpList = (
|
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
export const comparisonSubOpList: { |
|
|
|
|
export const comparisonSubOpList = ( |
|
|
|
|
// TODO: type
|
|
|
|
|
comparison_op: string, |
|
|
|
|
): { |
|
|
|
|
text: string |
|
|
|
|
value: string |
|
|
|
|
ignoreVal: boolean |
|
|
|
|
includedTypes?: UITypes[] |
|
|
|
|
excludedTypes?: UITypes[] |
|
|
|
|
}[] = [ |
|
|
|
|
}[] => { |
|
|
|
|
if (comparison_op === 'isWithin') { |
|
|
|
|
return [ |
|
|
|
|
{ |
|
|
|
|
text: 'the past week', |
|
|
|
|
value: 'pastWeek', |
|
|
|
|
ignoreVal: true, |
|
|
|
|
includedTypes: [UITypes.Date, UITypes.DateTime], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: 'the past month', |
|
|
|
|
value: 'pastMonth', |
|
|
|
|
ignoreVal: true, |
|
|
|
|
includedTypes: [UITypes.Date, UITypes.DateTime], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: 'the past year', |
|
|
|
|
value: 'pastYear', |
|
|
|
|
ignoreVal: true, |
|
|
|
|
includedTypes: [UITypes.Date, UITypes.DateTime], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: 'the next week', |
|
|
|
|
value: 'nextWeek', |
|
|
|
|
ignoreVal: true, |
|
|
|
|
includedTypes: [UITypes.Date, UITypes.DateTime], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: 'the next month', |
|
|
|
|
value: 'nextMonth', |
|
|
|
|
ignoreVal: true, |
|
|
|
|
includedTypes: [UITypes.Date, UITypes.DateTime], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: 'the next year', |
|
|
|
|
value: 'nextYear', |
|
|
|
|
ignoreVal: true, |
|
|
|
|
includedTypes: [UITypes.Date, UITypes.DateTime], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: 'the next number of days', |
|
|
|
|
value: 'pastNumberOfDays', |
|
|
|
|
ignoreVal: false, |
|
|
|
|
includedTypes: [UITypes.Date, UITypes.DateTime], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
text: 'the past number of days', |
|
|
|
|
value: 'nextNumberOfDays', |
|
|
|
|
ignoreVal: false, |
|
|
|
|
includedTypes: [UITypes.Date, UITypes.DateTime], |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
return [ |
|
|
|
|
{ |
|
|
|
|
text: 'today', |
|
|
|
|
value: 'today', |
|
|
|
@ -308,4 +364,5 @@ export const comparisonSubOpList: {
|
|
|
|
|
ignoreVal: false, |
|
|
|
|
includedTypes: [UITypes.Date, UITypes.DateTime], |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|