Created
December 22, 2016 01:39
-
-
Save omarkdev/94a25483df44976f358ff6794358110d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Sherlock\Traits; | |
trait DateTrait { | |
protected $months = [ | |
'Jan' => 'janeiro', | |
'Feb' => 'fevereiro', | |
'Mar' => 'março', | |
'Apr' => 'abril', | |
'May' => 'maio', | |
'Jun' => 'junho', | |
'Jul' => 'julho', | |
'Aug' => 'agosto', | |
'Nov' => 'novembro', | |
'Sep' => 'setembro', | |
'Oct' => 'outubro', | |
'Dec' => 'dezembro' | |
]; | |
protected function replaceMonths($date) | |
{ | |
foreach($this->months as $enMonth => $month){ | |
$date = str_replace($month, $enMonth, $date); | |
} | |
return $date; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment