Add Backend::date shorthand helper

This commit is contained in:
Samuel Georges 2016-11-30 06:59:50 +11:00
parent b39ebec812
commit 85ca7715f2
1 changed files with 10 additions and 0 deletions

View File

@ -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 = [])
{