feat(tasks): update due date text every minute
Related discussion: https://community.vikunja.io/t/text-describing-time-past-due-date-is-never-refreshed/1376/3
This commit is contained in:
parent
725fd1ad46
commit
abbc11528e
@ -70,7 +70,7 @@
|
|||||||
class="is-italic"
|
class="is-italic"
|
||||||
:aria-expanded="showDefer ? 'true' : 'false'"
|
:aria-expanded="showDefer ? 'true' : 'false'"
|
||||||
>
|
>
|
||||||
– {{ $t('task.detail.due', {at: formatDateSince(task.dueDate)}) }}
|
– {{ $t('task.detail.due', {at: dueDateFormatted}) }}
|
||||||
</time>
|
</time>
|
||||||
</BaseButton>
|
</BaseButton>
|
||||||
<CustomTransition name="fade">
|
<CustomTransition name="fade">
|
||||||
@ -150,6 +150,7 @@ import {useProjectStore} from '@/stores/projects'
|
|||||||
import {useBaseStore} from '@/stores/base'
|
import {useBaseStore} from '@/stores/base'
|
||||||
import {useTaskStore} from '@/stores/tasks'
|
import {useTaskStore} from '@/stores/tasks'
|
||||||
import AssigneeList from '@/components/tasks/partials/assigneeList.vue'
|
import AssigneeList from '@/components/tasks/partials/assigneeList.vue'
|
||||||
|
import {useIntervalFn} from '@vueuse/core'
|
||||||
|
|
||||||
const {
|
const {
|
||||||
theTask,
|
theTask,
|
||||||
@ -212,6 +213,20 @@ const taskDetailRoute = computed(() => ({
|
|||||||
// state: { backdropView: router.currentRoute.value.fullPath },
|
// state: { backdropView: router.currentRoute.value.fullPath },
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
function updateDueDate() {
|
||||||
|
if (!task.value.dueDate) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
dueDateFormatted.value = formatDateSince(task.value.dueDate)
|
||||||
|
}
|
||||||
|
|
||||||
|
const dueDateFormatted = ref('')
|
||||||
|
useIntervalFn(updateDueDate, 60_000, {
|
||||||
|
immediateCallback: true,
|
||||||
|
})
|
||||||
|
onMounted(updateDueDate)
|
||||||
|
|
||||||
|
|
||||||
async function markAsDone(checked: boolean) {
|
async function markAsDone(checked: boolean) {
|
||||||
const updateFunc = async () => {
|
const updateFunc = async () => {
|
||||||
@ -246,6 +261,7 @@ async function toggleFavorite() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const deferDueDate = ref<typeof DeferTask | null>(null)
|
const deferDueDate = ref<typeof DeferTask | null>(null)
|
||||||
|
|
||||||
function hideDeferDueDatePopup(e) {
|
function hideDeferDueDatePopup(e) {
|
||||||
if (!showDefer.value) {
|
if (!showDefer.value) {
|
||||||
return
|
return
|
||||||
@ -391,7 +407,7 @@ function hideDeferDueDatePopup(e) {
|
|||||||
color: var(--danger);
|
color: var(--danger);
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="checkbox"] {
|
input[type='checkbox'] {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user