Skip to content
Snippets Groups Projects
Commit b949e3e2 authored by Antonin's avatar Antonin
Browse files

Using I18N for DatePicker in addColumn

parent 905208c2
No related branches found
No related tags found
No related merge requests found
...@@ -359,6 +359,7 @@ if (isset($_GET['delete_column'])) { ...@@ -359,6 +359,7 @@ if (isset($_GET['delete_column'])) {
// ------------------------------- // -------------------------------
// Add a slot // Add a slot
// ------------------------------- // -------------------------------
function exit_displaying_add_column($message = null) { function exit_displaying_add_column($message = null) {
global $smarty, $poll_id, $admin_poll_id, $poll; global $smarty, $poll_id, $admin_poll_id, $poll;
$smarty->assign('poll_id', $poll_id); $smarty->assign('poll_id', $poll_id);
...@@ -381,10 +382,10 @@ if (isset($_POST['confirm_add_column'])) { ...@@ -381,10 +382,10 @@ if (isset($_POST['confirm_add_column'])) {
exit_displaying_add_column(new Message('danger', __('Error', "Can't create an empty column."))); exit_displaying_add_column(new Message('danger', __('Error', "Can't create an empty column.")));
} }
if ($poll->format === 'D') { if ($poll->format === 'D') {
$newdate = strip_tags($_POST['newdate']); $date = DateTime::createFromFormat(__('Date', 'datetime_parseformat'), $_POST['newdate'])->setTime(0, 0, 0);
$time = $date->getTimestamp();
$newmoment = str_replace(',', '-', strip_tags($_POST['newmoment'])); $newmoment = str_replace(',', '-', strip_tags($_POST['newmoment']));
$ex = explode('/', $newdate); $adminPollService->addDateSlot($poll_id, $time, $newmoment);
$adminPollService->addDateSlot($poll_id, mktime(0, 0, 0, $ex[1], $ex[0], $ex[2]), $newmoment);
} else { } else {
$newslot = str_replace(',', '-', strip_tags($_POST['choice'])); $newslot = str_replace(',', '-', strip_tags($_POST['choice']));
$adminPollService->addClassicSlot($poll_id, $newslot); $adminPollService->addClassicSlot($poll_id, $newslot);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment