Bug fixed, Date helper

This commit is contained in:
dignajar 2015-11-30 20:07:06 -03:00
parent cb557eb7c4
commit 29c44cdbe1
3 changed files with 7 additions and 3 deletions

View File

@ -30,7 +30,6 @@ define('PATH_BOOT', PATH_ROOT.'kernel'.DS.'boot'.DS);
// Init
require(PATH_BOOT.'init.php');
// Admin area
if($Url->whereAmI()==='admin') {
require(PATH_BOOT.'admin.php');

View File

@ -25,11 +25,16 @@ class Date {
// Format a local time/date according to locale settings.
public static function format($date, $currentFormat, $outputFormat)
{
// Returns a new DateTime instance or FALSE on failure.
$Date = DateTime::createFromFormat($currentFormat, $date);
if($Date!==false) {
return $Date->format($outputFormat);
}
return false;
}
public static function timeago($time)
{
$time = time() - $time;

View File

@ -79,7 +79,7 @@ class Page extends fileContent
}
// Returns the post date according to locale settings and format settings.
public function date($format=false)
public function date()
{
return $this->getField('date');
}