feat: add date math for filters #1342
|
@ -191,7 +191,7 @@ const props = defineProps({
|
|||
showSelectedOnButton: {
|
||||
konrad marked this conversation as resolved
Outdated
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
// FIXME: This seems to always contain the default value - that breaks the picker
|
||||
dpschen
commented
Continuing from #1261 (comment) With default value you mean the value of store.state.auth.settings.weekStart? Continuing from https://kolaente.dev/vikunja/frontend/pulls/1261#issuecomment-22675
With default value you mean the value of store.state.auth.settings.weekStart?
konrad
commented
As said in #1261:
As said in #1261:
> It's not reflected in the flatpicker config (below). That always contains `0` as week start, no matter what is set in store.
|
||||
|
|
|
@ -20,7 +20,7 @@ const props = defineProps({
|
|||
hasOverflow: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
function hidePopup(e) {
|
||||
|
|
|
@ -98,6 +98,8 @@ export default {
|
|||
pageTitle() {
|
||||
konrad marked this conversation as resolved
Outdated
dpschen
commented
Remove title var and return directly:
Remove title var and return directly:
```js
if (typeof predefinedRange !== 'undefined') {
return t(`input.datepickerRange.ranges.${predefinedRangeKey}`)
} else {
return showAll
? t('task.show.titleCurrent')
: t('task.show.fromuntil', {
from: formatDate(dateFrom, 'PPP'),
until: formatDate(dateTo, 'PPP'),
})
}
konrad
commented
Done. Done.
|
||||
let title = ''
|
||||
|
||||
// We need to define "key" because it is the first parameter in the array and we need the second
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const predefinedRange = Object.entries(dateRanges).find(([key, value]) => this.dateFrom === value[0] && this.dateTo === value[1])
|
||||
if (typeof predefinedRange !== 'undefined') {
|
||||
title = this.$t(`input.datepickerRange.ranges.${predefinedRange[0]}`)
|
||||
|
|
Reference in New Issue
We could remove this prop if we would only expose the slot for the trigger.
Done.