change diffrent format and predefine format
This commit is contained in:
1 parent
2acc6826ab
commit
52f1bd994b
2 files changed
+17
-35
No files matched your search
+1
-14
@@ -82,15 +82,6 @@ class Verta extends DateTime {
|
||||
self::FRIDAY,
|
||||
);
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static $formats = array(
|
||||
'datetime' => 'Y-m-d H:i:s',
|
||||
'date' => 'Y-m-d',
|
||||
'time' => 'H:i:s',
|
||||
);
|
||||
|
||||
/**
|
||||
* Default format to use for __toString method when type juggling occurs.
|
||||
*/
|
||||
@@ -1153,10 +1144,6 @@ class Verta extends DateTime {
|
||||
* @return string
|
||||
*/
|
||||
public function format($format) {
|
||||
|
||||
if (in_array($format, array_keys(self::$formats))) {
|
||||
$format = self::$formats[$format];
|
||||
}
|
||||
return $this->strftime($format);
|
||||
}
|
||||
|
||||
@@ -1228,7 +1215,7 @@ class Verta extends DateTime {
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function diffFormat(Verta $v = null)
|
||||
public function formatDifference(Verta $v = null)
|
||||
{
|
||||
$difference = $this->diffSeconds($v);
|
||||
$absolute = $difference < 0 ? self::POST : self::PRE;
|
||||
|
||||
Reference in new issue
Block a user