|
|
|
@ -356,6 +356,7 @@ class DateLocale {
|
|
|
|
|
public $iLocale = 'C'; // environmental locale be used by default |
|
|
|
|
private $iDayAbb = null, $iShortDay = null, $iShortMonth = null, $iMonthName = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function __construct() { |
|
|
|
|
settype($this->iDayAbb, 'array'); |
|
|
|
|
settype($this->iShortDay, 'array'); |
|
|
|
@ -391,16 +392,30 @@ class DateLocale {
|
|
|
|
|
return FALSE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->iLocale = $aLocale; |
|
|
|
|
for( $i = 0, $ofs = 0 - strftime('%w'); $i < 7; $i++, $ofs++ ) { |
|
|
|
|
$day = strftime('%a', strtotime("$ofs day")); |
|
|
|
|
$date_day = new DateTimeImmutable(); |
|
|
|
|
for( $i = 0, $ofs = 0 - $date_day->format("w"); $i < 7; $i++, $ofs++ ) { |
|
|
|
|
|
|
|
|
|
if($ofs > 0){ // acrescentar a data |
|
|
|
|
$date_day = $date_day->add(new DateInterval("P{$ofs}D")); |
|
|
|
|
} |
|
|
|
|
else if( $ofs < 0 ){ // decrementar a data |
|
|
|
|
$date_day = $date_day->sub(new DateInterval(sprintf("P%dD", abs($ofs)))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$day = $date_day->format("D"); |
|
|
|
|
$day[0] = strtoupper($day[0]); |
|
|
|
|
$this->iDayAbb[$aLocale][]= $day[0]; |
|
|
|
|
$this->iShortDay[$aLocale][]= $day; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for($i=1; $i<=12; ++$i) { |
|
|
|
|
list($short ,$full) = explode('|', strftime("%b|%B",strtotime("2001-$i-01"))); |
|
|
|
|
|
|
|
|
|
/* Apenas obtem nome completo e abreviado dos meses */ |
|
|
|
|
$date_month = new DateTimeImmutable(); |
|
|
|
|
list($short ,$full) = explode('|', $date_month->format('M|F')); |
|
|
|
|
|
|
|
|
|
$this->iShortMonth[$aLocale][] = ucfirst($short); |
|
|
|
|
$this->iMonthName [$aLocale][] = ucfirst($full); |
|
|
|
|
} |
|
|
|
@ -410,7 +425,6 @@ class DateLocale {
|
|
|
|
|
return TRUE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function GetDayAbb() { |
|
|
|
|
return $this->iDayAbb[$this->iLocale]; |
|
|
|
|
} |
|
|
|
|