Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/files_reminders/lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ public function get(int $fileId): DataResponse {
public function set(int $fileId, string $dueDate): DataResponse {
try {
$dueDate = (new DateTime($dueDate))->setTimezone(new DateTimeZone('UTC'));
$nowDate = (new DateTime('now'))->setTimezone(new DateTimeZone('UTC'));
if ($dueDate <= $nowDate) {
return new DataResponse([], Http::STATUS_BAD_REQUEST);
}
} catch (Exception $e) {
$this->logger->error($e->getMessage(), ['exception' => $e]);
return new DataResponse([], Http::STATUS_BAD_REQUEST);
Expand Down
Loading