From 85ca7715f245aea6eda800859bb6ed095595b7ab Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Wed, 30 Nov 2016 06:59:50 +1100 Subject: [PATCH] Add Backend::date shorthand helper --- modules/backend/helpers/Backend.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/backend/helpers/Backend.php b/modules/backend/helpers/Backend.php index f9a141af5..ee4b9f779 100644 --- a/modules/backend/helpers/Backend.php +++ b/modules/backend/helpers/Backend.php @@ -83,6 +83,15 @@ class Backend return Redirect::intended($this->uri() . '/' . $path, $status, $headers, $secure); } + /** + * Proxy method for dateTime() using "date" format alias. + * @return string + */ + public function date($dateTime, $options = []) + { + return $this->dateTime($dateTime, $options + ['formatAlias' => 'date']); + } + /** * Returns the HTML for a date formatted in the backend. * Supported for formatAlias: @@ -96,6 +105,7 @@ class Backend * dateTimeMin -> Apr 23, 2016 6:28 AM * dateTimeLong -> Saturday, April 23, 2016 6:28 AM * dateTimeLongMin -> Sat, Apr 23, 2016 6:29 AM + * @return string */ public function dateTime($dateTime, $options = []) {