summaryrefslogtreecommitdiff
path: root/app/Model/DateParser.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-10-05 11:22:10 -0400
committerFrédéric Guillot <fred@kanboard.net>2014-10-05 11:22:10 -0400
commitbae57838c2dd789064b246308c7cb3a33bba5b8e (patch)
treeb43db60ada251debd3bf5d900d017b2cd29e421f /app/Model/DateParser.php
parent8e5673e3d289e4d28b4fc9f20721bda9f1c858c7 (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.php19
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