Date traits
This commit is contained in:
13
common/Define/Model/Date.php
Normal file
13
common/Define/Model/Date.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace ProVM\Common\Define\Model;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
trait Date {
|
||||
public function date(\DateTime $date) {
|
||||
if ($date === null) {
|
||||
return Carbon::parse($this->date);
|
||||
}
|
||||
$this->date = $data->format('Y-m-d');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user