Fixed: Wrong date format on front-end

This commit is contained in:
fred
2017-06-21 12:06:34 +02:00
parent 2c35c7061e
commit 5e152ebaa1

View File

@ -473,7 +473,27 @@ class MP2Migrator {
$params['validate'] = $this->mapCustomFieldValidateValue($params['validate']);
}
if(isset($params['date_order'])) { // Convert the date_order field
$params['date_format'] = strtoupper($params['date_order']);
switch($params['date_type']) {
case 'year_month':
if(preg_match('/y$/i', $params['date_order'])) {
$params['date_format'] = 'MM/YYYY';
} else {
$params['date_format'] = 'YYYY/MM';
}
break;
case 'month';
$params['date_format'] = 'MM';
break;
case 'year';
$params['date_format'] = 'YYYY';
break;
default:
$params['date_format'] = strtoupper($params['date_order']);
}
unset($params['date_order']);
}
return $params;