mirror of
https://framagit.org/framasoft/framadate/framadate
synced 2026-01-23 02:14:06 +00:00
Refactor calculating max/min expiration date and enforce on poll edition
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
9c969f8896
commit
5a5c233a5e
6 changed files with 46 additions and 77 deletions
|
|
@ -80,7 +80,7 @@ $messagePollCreated = $sessionService->get("Framadate", "messagePollCreated", FA
|
|||
|
||||
if ($messagePollCreated) {
|
||||
$sessionService->remove("Framadate", "messagePollCreated");
|
||||
|
||||
|
||||
$message = new Message('success', __('adminstuds', 'The poll is created.'));
|
||||
}
|
||||
|
||||
|
|
@ -137,9 +137,9 @@ if (isset($_POST['update_poll_info'])) {
|
|||
break;
|
||||
}
|
||||
} elseif ($field === 'expiration_date') {
|
||||
$expiration_date = $inputService->filterDate($_POST['expiration_date']);
|
||||
$expiration_date = $inputService->validateDate($_POST['expiration_date'], $pollService->minExpiryDate(), $pollService->maxExpiryDate());
|
||||
if ($expiration_date) {
|
||||
$poll->end_date = $expiration_date;
|
||||
$poll->end_date = $expiration_date->getTimestamp();
|
||||
$updated = true;
|
||||
}
|
||||
} elseif ($field === 'name') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue