diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-10-05 11:22:10 -0400 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-10-05 11:22:10 -0400 |
commit | bae57838c2dd789064b246308c7cb3a33bba5b8e (patch) | |
tree | b43db60ada251debd3bf5d900d017b2cd29e421f /app/Model/DateParser.php | |
parent | 8e5673e3d289e4d28b4fc9f20721bda9f1c858c7 (diff) |
Input date format is now a config parameter instead of the current locale
Diffstat (limited to 'app/Model/DateParser.php')
-rw-r--r-- | app/Model/DateParser.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/app/Model/DateParser.php b/app/Model/DateParser.php index b051fb6e..88e67686 100644 --- a/app/Model/DateParser.php +++ b/app/Model/DateParser.php @@ -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,13 +65,28 @@ 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 * * @access public |