From 28a7f57d86c2c2fbef92da37eacb19980a133ed2 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 25 Jan 2015 18:55:11 -0500 Subject: Store due date without the time --- app/Model/DateParser.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/Model/DateParser.php') diff --git a/app/Model/DateParser.php b/app/Model/DateParser.php index 53fc9b76..8a4d3edd 100644 --- a/app/Model/DateParser.php +++ b/app/Model/DateParser.php @@ -87,13 +87,13 @@ class DateParser extends Base } /** - * For a given timestamp, reset the date to midnight + * Remove the time from a timestamp * * @access public * @param integer $timestamp Timestamp * @return integer */ - public function resetDateToMidnight($timestamp) + public function removeTimeFromTimestamp($timestamp) { return mktime(0, 0, 0, date('m', $timestamp), date('d', $timestamp), date('Y', $timestamp)); } @@ -107,7 +107,7 @@ class DateParser extends Base */ public function getTimestampFromIsoFormat($date) { - return $this->resetDateToMidnight(strtotime($date)); + return $this->removeTimeFromTimestamp(strtotime($date)); } /** @@ -147,7 +147,7 @@ class DateParser extends Base foreach ($fields as $field) { if (! empty($values[$field]) && ! is_numeric($values[$field])) { - $values[$field] = $this->getTimestamp($values[$field]); + $values[$field] = $this->removeTimeFromTimestamp($this->getTimestamp($values[$field])); } } } -- cgit v1.2.3