diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-08-22 16:20:53 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-08-22 16:20:53 -0400 |
commit | fd60964c239627d2d55c6eca0888be84a8f6653f (patch) | |
tree | 062836c4a49857625a25b2cfdd3bbb93732f915d /app/Model/DateParser.php | |
parent | 18fd39e6d648a58be0782d514604877504833832 (diff) |
Add global Gantt chart for all projects
Diffstat (limited to 'app/Model/DateParser.php')
-rw-r--r-- | app/Model/DateParser.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/app/Model/DateParser.php b/app/Model/DateParser.php index 036725e3..6e833061 100644 --- a/app/Model/DateParser.php +++ b/app/Model/DateParser.php @@ -77,7 +77,7 @@ class DateParser extends Base } /** - * Parse a date ad return a unix timestamp, try different date formats + * Parse a date and return a unix timestamp, try different date formats * * @access public * @param string $value Date to parse @@ -97,6 +97,18 @@ class DateParser extends Base } /** + * Get ISO8601 date from user input + * + * @access public + * @param string $value Date to parse + * @return string + */ + public function getIsoDate($value) + { + return date('Y-m-d', ctype_digit($value) ? $value : $this->getTimestamp($value)); + } + + /** * Get all combinations of date/time formats * * @access public |