From c53ddbc60e1e1b9476fda1d227cc5882e5642d5c Mon Sep 17 00:00:00 2001 From: bahman Date: Sun, 31 May 2026 10:27:20 +0330 Subject: [PATCH 1/4] fix(deck): add min and max date limits to DueDateSelector Signed-off-by: Bahman Jafarzadeh --- src/components/card/DueDateSelector.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/card/DueDateSelector.vue b/src/components/card/DueDateSelector.vue index b9f2669d77..51004141ca 100644 --- a/src/components/card/DueDateSelector.vue +++ b/src/components/card/DueDateSelector.vue @@ -12,7 +12,8 @@ v-model="duedate" :placeholder="t('deck', 'Set a due date')" :hide-label="true" - type="datetime-local" /> + type="datetime-local" + :max="new Date('9999-12-31T23:59:59')" /> Date: Sun, 31 May 2026 10:29:34 +0330 Subject: [PATCH 2/4] feat(validators): add date validation method Signed-off-by: Bahman Jafarzadeh --- lib/Validators/BaseValidator.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Validators/BaseValidator.php b/lib/Validators/BaseValidator.php index 79e285ba60..6cc4e42165 100644 --- a/lib/Validators/BaseValidator.php +++ b/lib/Validators/BaseValidator.php @@ -107,6 +107,16 @@ private function not_empty($value): bool { return !empty($value); } + /** + * @param $value + * @return bool + */ + private function date(string $value): bool { + $date = \DateTime::createFromFormat('Y-m-d\TH:i:s.v\Z', $value) + ?: \DateTime::createFromFormat(\DateTime::ATOM, $value); + return $date !== false; + } + /** * @throws Exception */ From 87fedeab8bfb3bdcd1fb85773398b0a149ebc46e Mon Sep 17 00:00:00 2001 From: Bahman Jafarzadeh Date: Sun, 31 May 2026 10:29:56 +0330 Subject: [PATCH 3/4] feat(card): add duedate validation rule Signed-off-by: Bahman Jafarzadeh --- lib/Validators/CardServiceValidator.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Validators/CardServiceValidator.php b/lib/Validators/CardServiceValidator.php index ddbcf8738c..bc392c76e3 100644 --- a/lib/Validators/CardServiceValidator.php +++ b/lib/Validators/CardServiceValidator.php @@ -21,6 +21,7 @@ public function rules() { 'type' => ['not_empty', 'not_null', 'not_false', 'max:64'], 'order' => ['numeric'], 'owner' => ['not_empty', 'not_null', 'not_false', 'max:64'], + 'duedate' => ['date'], ]; } } From 9be1702313cca79cabc0462bef6de66febaa07b3 Mon Sep 17 00:00:00 2001 From: Bahman Jafarzadeh Date: Sun, 31 May 2026 10:33:50 +0330 Subject: [PATCH 4/4] fix(card): include duedate in card update validation Signed-off-by: Bahman Jafarzadeh --- lib/Service/CardService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/CardService.php b/lib/Service/CardService.php index f5995874f4..b9ebe8e75c 100644 --- a/lib/Service/CardService.php +++ b/lib/Service/CardService.php @@ -234,7 +234,7 @@ public function delete(int $id): Card { * @throws BadRequestException */ public function update(int $id, string $title, int $stackId, string $type, string $owner, string $description = '', int $order = 0, ?string $duedate = null, ?int $deletedAt = null, ?bool $archived = null, ?OptionalNullableValue $done = null): Card { - $this->cardServiceValidator->check(compact('id', 'title', 'stackId', 'type', 'owner', 'order')); + $this->cardServiceValidator->check(compact('id', 'title', 'stackId', 'type', 'owner', 'order', 'duedate')); $this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT, allowDeletedCard: true); $this->permissionService->checkPermission($this->stackMapper, $stackId, Acl::PERMISSION_EDIT);