Input date format is now a config parameter instead of the current locale

This commit is contained in:
Frédéric Guillot
2014-10-05 11:22:10 -04:00
parent 8e5673e3d2
commit bae57838c2
23 changed files with 84 additions and 35 deletions

View File

@@ -57,7 +57,7 @@ class DateParser extends Base
}
/**
* Return the list of supported date formats
* Return the list of supported date formats (for the parser)
*
* @access public
* @return array
@@ -65,12 +65,27 @@ class DateParser extends Base
public function getDateFormats()
{
return array(
t('m/d/Y'),
$this->config->get('application_date_format', 'm/d/Y'),
'Y-m-d',
'Y_m_d',
);
}
/**
* Return the list of available date formats (for the config page)
*
* @access public
* @return array
*/
public function getAvailableFormats()
{
return array(
'm/d/Y' => date('m/d/Y'),
'd/m/Y' => date('d/m/Y'),
'Y/m/d' => date('Y/m/d'),
);
}
/**
* For a given timestamp, reset the date to midnight
*