From 4e3c0549d742f40dc1025f2de1e68dbf881a6dca Mon Sep 17 00:00:00 2001 From: Sunik Kupfer Date: Fri, 5 Jan 2024 17:04:12 +0100 Subject: [PATCH] [WIP] Introduce RepeatFreqInterval --- src/components/AppSidebar/RepeatItem.vue | 10 +++- .../RepeatItem/RepeatFreqInterval.vue | 59 +++++++++++++++++++ src/models/task.js | 4 +- src/views/AppSidebar.vue | 4 +- 4 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 src/components/AppSidebar/RepeatItem/RepeatFreqInterval.vue diff --git a/src/components/AppSidebar/RepeatItem.vue b/src/components/AppSidebar/RepeatItem.vue index ceb4f4c95..4799ef41b 100644 --- a/src/components/AppSidebar/RepeatItem.vue +++ b/src/components/AppSidebar/RepeatItem.vue @@ -27,7 +27,7 @@ License along with this library. If not, see . + :recurrence-rule="recurrenceRule" /> @@ -47,6 +49,7 @@ License along with this library. If not, see . import { translate as t } from '@nextcloud/l10n' import RepeatSummary from './RepeatItem/RepeatSummary.vue' +import RepeatFreqInterval from './RepeatItem/RepeatFreqInterval.vue' import Pencil from 'vue-material-design-icons/Pencil.vue' import Check from 'vue-material-design-icons/Check.vue' import { NcActions as Actions, NcActionButton as ActionButton } from '@nextcloud/vue' @@ -54,13 +57,14 @@ import { NcActions as Actions, NcActionButton as ActionButton } from '@nextcloud export default { components: { RepeatSummary, + RepeatFreqInterval, Actions, ActionButton, Pencil, Check, }, props: { - recurrence: { + recurrenceRule: { type: Object, required: true, }, diff --git a/src/components/AppSidebar/RepeatItem/RepeatFreqInterval.vue b/src/components/AppSidebar/RepeatItem/RepeatFreqInterval.vue new file mode 100644 index 000000000..acee57e6d --- /dev/null +++ b/src/components/AppSidebar/RepeatItem/RepeatFreqInterval.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/src/models/task.js b/src/models/task.js index e4c1e98b2..4c2b7750f 100644 --- a/src/models/task.js +++ b/src/models/task.js @@ -336,7 +336,7 @@ export default class Task { * @readonly * @memberof Task */ - get recurrence() { + get recurrenceRule() { if (this._recurrence === undefined || this._recurrence === null) { return getDefaultRecurrenceRuleObject() } @@ -707,7 +707,7 @@ export default class Task { */ completeRecurring() { // Get recurrence iterator, starting at start date - const iter = this.recurrence.iterator(this.start) + const iter = this.recurrenceRule.iterator(this.start) // Skip the start date itself iter.next() // If there is a next recurrence, update the start date to next recurrence date diff --git a/src/views/AppSidebar.vue b/src/views/AppSidebar.vue index 5e76c2709..557352508 100644 --- a/src/views/AppSidebar.vue +++ b/src/views/AppSidebar.vue @@ -193,8 +193,8 @@ License along with this library. If not, see . @add-tag="updateTag" @set-tags="updateTags" />