Fix the date parsing in step 3 of date poll creation

This commit is contained in:
Olivier PEREZ 2015-11-02 23:02:35 +01:00
parent 9accf7dab8
commit c2f5c4731a
6 changed files with 7 additions and 2 deletions

View File

@ -133,8 +133,8 @@ if (!isset($_SESSION['form']->title) || !isset($_SESSION['form']->admin_name) ||
if (!empty($day)) {
// Add choice to Form data
// TODO Fix the parse
$time = mktime(0, 0, 0, substr($_POST["days"][$i],3,2),substr($_POST["days"][$i],0,2),substr($_POST["days"][$i],6,4));
$date = DateTime::createFromFormat(__('Date', 'datetime_parseformat'), $_POST['days'][$i])->setTime(0, 0, 0);
$time = $date->getTimestamp();
$choice = new Choice($time);
$_SESSION['form']->addChoice($choice);

View File

@ -43,6 +43,7 @@
"Date": {
"dd/mm/yyyy": "dd/mm/yyyy",
"datepicker": "yyyy-mm-dd",
"datetime_parseformat": "Y-m-d",
"%A, den %e. %B %Y": "%A %e %B %Y",
"FULL": "%A, den %e. %B %Y",
"SHORT": "%A %e %B %Y",

View File

@ -43,6 +43,7 @@
"Date" : {
"dd/mm/yyyy": "yyyy-mm-dd",
"datepicker": "yyyy-mm-dd",
"datetime_parseformat": "Y-m-d",
"%A, den %e. %B %Y": "%A %e %B %Y",
"FULL": "%A, %B %e, %Y",
"SHORT": "%A %e %B %Y",

View File

@ -43,6 +43,7 @@
"Date": {
"dd/mm/yyyy": "ES_jj/mm/aaaa",
"datepicker": "yyyy-mm-dd",
"datetime_parseformat": "Y-m-d",
"%A, den %e. %B %Y": "%A %e de %B %Y",
"FULL": "ES_%A, den %e. %B %Y",
"SHORT": "ES_%A %e %B %Y",

View File

@ -43,6 +43,7 @@
"Date": {
"dd/mm/yyyy": "jj/mm/aaaa",
"datepicker": "dd/mm/yyyy",
"datetime_parseformat": "d/m/Y",
"%A, den %e. %B %Y": "%A %e %B %Y",
"FULL": "%A %e %B %Y",
"SHORT": "%A %e %B %Y",

View File

@ -43,6 +43,7 @@
"Date": {
"dd/mm/yyyy": "gg/mm/aaaa",
"datepicker": "gg/mm/yyyy",
"datetime_parseformat": "g/m/Y",
"%A, den %e. %B %Y": "%A %e %B %Y",
"FULL": "%A %e %B %Y",
"SHORT": "%A %e %B %Y",