summaryrefslogtreecommitdiff
path: root/app/Model/DateParser.php
diff options
context:
space:
mode:
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