From 048401fa843588f702546ae47d4a2a501b29b823 Mon Sep 17 00:00:00 2001 From: bahman Date: Tue, 9 Dec 2025 10:15:07 +0330 Subject: [PATCH 1/4] fix(deck): add min and max date limits to DueDateSelector - Set maximum date to December 31, 9999 Signed-off-by: bahman --- src/components/card/DueDateSelector.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/card/DueDateSelector.vue b/src/components/card/DueDateSelector.vue index b9f2669d7..3d2b493e9 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: Tue, 9 Dec 2025 18:00:04 +0330 Subject: [PATCH 2/4] feat(validators): add date validation method - Implemented date validation using DateTime::createFromFormat - Supports both 'Y-m-d\TH:i:s.v\Z' and ATOM formats - Returns boolean indicating if value is valid date Signed-off-by: bahman --- lib/Validators/BaseValidator.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Validators/BaseValidator.php b/lib/Validators/BaseValidator.php index 6ae05d4a9..2e358768b 100644 --- a/lib/Validators/BaseValidator.php +++ b/lib/Validators/BaseValidator.php @@ -112,6 +112,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 84b873d57decc35f34757ed11ce545a9c08870ee Mon Sep 17 00:00:00 2001 From: bahman Date: Tue, 9 Dec 2025 18:00:42 +0330 Subject: [PATCH 3/4] feat(card): add duedate validation rule - Added date validation for duedate field in CardServiceValidator Signed-off-by: bahman --- lib/Validators/CardServiceValidator.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Validators/CardServiceValidator.php b/lib/Validators/CardServiceValidator.php index ddbcf8738..bc392c76e 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 1c77d11d13ca41a30f1f1fd8e80cc65f288a921b Mon Sep 17 00:00:00 2001 From: bahman Date: Tue, 9 Dec 2025 18:01:08 +0330 Subject: [PATCH 4/4] fix(card): include duedate in card update validation - Added 'duedate' parameter to the validation check in update method Signed-off-by: bahman --- 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 f5995874f..b9ebe8e75 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);