-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement getHolidayName * Allow to call with DateTime objects * Implement swapDateTimeParam and isDateTimeInstance methods
- Loading branch information
1 parent
ad74d83
commit c12276f
Showing
13 changed files
with
296 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
$keys = array(); | ||
foreach (glob('src/Cmixin/Holidays/*.php') as $file) { | ||
$keys = array_merge($keys, include $file); | ||
} | ||
$keys = array_keys($keys); | ||
$length = max(array_map('strlen', $keys)); | ||
sort($keys); | ||
|
||
foreach (glob('src/Cmixin/HolidayNames/*.php') as $file) { | ||
$data = include $file; | ||
$newData = array(); | ||
|
||
foreach ($keys as $key) { | ||
$newData[$key] = isset($data[$key]) ? $data[$key] : 'Unknown'; | ||
} | ||
|
||
if (true || $newData !== $data) { | ||
$data = str_replace('array (', 'array(', var_export($newData, true)); | ||
$data = preg_replace_callback('/^\s*\'([^\']+)\'\s*=>/m', function ($match) use ($length) { | ||
$key = $match[1]; | ||
$spaces = str_repeat(' ', $length - strlen($key)); | ||
|
||
return " '$key'$spaces =>"; | ||
}, $data); | ||
file_put_contents($file, "<?php\n\nreturn $data;\n"); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
return array( | ||
'armistice-1918' => 'Armistice 1918', | ||
'ascension' => 'Ascension', | ||
'assumption' => 'Assomption', | ||
'christmas' => 'Christmas', | ||
'christmas-next-day' => 'Christmas next day', | ||
'easter' => 'Easter', | ||
'easter-monday' => 'Easter Monday', | ||
'epiphany' => 'Epiphany', | ||
'good-friday' => 'Good Friday', | ||
'independence-day' => 'Independence Day', | ||
'labor-day' => 'Labor Day', | ||
'liberation-day' => 'Liberation Day', | ||
'memorial-day' => 'Memorial Day', | ||
'mlk-day' => 'Martin Luther King Jr. Day', | ||
'national-day' => 'National Day', | ||
'new-year' => 'New Year', | ||
'new-year-next-day' => 'New Year next day', | ||
'pentecost' => 'Pentecost', | ||
'pentecost-monday' => 'Pentecost Monday', | ||
'preseren-day' => 'Prešeren Day', | ||
'rebellion-day' => 'Rebellion Day', | ||
'reformation-day' => 'Reformation Day', | ||
'royal-day' => 'Royal Day', | ||
'thanksgiving' => 'Thanksgiving', | ||
'toussaint' => 'Toussaint', | ||
'vacation-day' => 'Vacation Day', | ||
'vacation-next-day' => 'Vacation Day next day', | ||
'victory-1945' => 'Victory 1945', | ||
); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
return array( | ||
'armistice-1918' => 'Armistice 1918', | ||
'ascension' => 'Ascension', | ||
'assumption' => 'Assomption', | ||
'christmas' => 'Noël', | ||
'christmas-next-day' => 'Saint Etienne', | ||
'easter' => 'Pâques', | ||
'easter-monday' => 'Lundi de Pâques', | ||
'epiphany' => 'Épiphanie', | ||
'good-friday' => 'Vendredi Saint', | ||
'independence-day' => 'Indépendance', | ||
'labor-day' => 'Fête du travail', | ||
'liberation-day' => 'Libération', | ||
'memorial-day' => 'Jour commémoratif', | ||
'mlk-day' => 'Jour de Martin Luther King', | ||
'national-day' => 'Fête nationale', | ||
'new-year' => 'Nouvel an', | ||
'new-year-next-day' => 'Lendemain du nouvel an', | ||
'pentecost' => 'Pentecôte', | ||
'pentecost-monday' => 'Lundi de Pentecôte', | ||
'preseren-day' => 'Jour de Prešeren', | ||
'rebellion-day' => 'Jour de la Rébellion', | ||
'reformation-day' => 'Jour de la Reformation', | ||
'royal-day' => 'Jour royal', | ||
'thanksgiving' => 'Thanksgiving', | ||
'toussaint' => 'Toussaint', | ||
'vacation-day' => 'Jour de vacances', | ||
'vacation-next-day' => 'Lendemain du jour de vacances', | ||
'victory-1945' => 'Victoire 1945', | ||
); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
return array( | ||
'armistice-1918' => 'Wapenstilstand 1918', | ||
'ascension' => 'Hemelvaart', | ||
'assumption' => 'Veronderstelling', | ||
'christmas' => 'Eerste Kerstdag', | ||
'christmas-next-day' => 'Tweede Kerstdag', | ||
'easter' => 'Paaszondag', | ||
'easter-monday' => 'Paasmaandag', | ||
'epiphany' => 'Driekoningen', | ||
'good-friday' => 'Goede Vrijdag', | ||
'independence-day' => 'Onafhankelijkheidsdag', | ||
'labor-day' => 'Dag van de Arbeid', | ||
'liberation-day' => 'Bevrijdingsdag', | ||
'memorial-day' => 'Herdenkingsdag', | ||
'mlk-day' => 'Martin Luther King Jr. Day', | ||
'national-day' => 'Nationale Dag', | ||
'new-year' => 'Nieuwjaarsdag', | ||
'new-year-next-day' => 'Nieuw jaar de volgende dag', | ||
'pentecost' => 'Pinksterzondag', | ||
'pentecost-monday' => 'Pinkstermaandag', | ||
'preseren-day' => 'Prešeren Dag', | ||
'rebellion-day' => 'Rebelliedag', | ||
'reformation-day' => 'Reformatie Dag', | ||
'royal-day' => 'Koningsdag', | ||
'thanksgiving' => 'Dankzegging', | ||
'toussaint' => 'Toussaint', | ||
'vacation-day' => 'Vakantiedag', | ||
'vacation-next-day' => 'Vakantiedag volgende dag', | ||
'victory-1945' => 'Overwinning 1945', | ||
); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
return array( | ||
'armistice-1918' => 'Premirje 1918', | ||
'ascension' => 'Vzpon', | ||
'assumption' => 'Marijino vnebovzetje', | ||
'christmas' => 'Božič', | ||
'christmas-next-day' => 'Božič naslednji dan', | ||
'easter' => 'Velika noč', | ||
'easter-monday' => 'Velikonočni ponedeljek', | ||
'epiphany' => 'Razodetje', | ||
'good-friday' => 'Dober petek', | ||
'independence-day' => 'Dan samostojnosti in enotnosti', | ||
'labor-day' => 'Dan dela', | ||
'liberation-day' => 'Dan osvoboditve', | ||
'memorial-day' => 'Dan spomina na mrtve', | ||
'mlk-day' => 'Martin Luther King mlajši dan', | ||
'national-day' => 'Dan državnosti', | ||
'new-year' => 'Novo leto', | ||
'new-year-next-day' => 'Novo leto naslednji dan', | ||
'pentecost' => 'Binkoštna nedelja', | ||
'pentecost-monday' => 'Binkoštna ponedeljek', | ||
'preseren-day' => 'Prešernov dan', | ||
'rebellion-day' => 'Dan upora proti okupatorju', | ||
'reformation-day' => 'Dan reformacije', | ||
'royal-day' => 'Kraljevi dan', | ||
'thanksgiving' => 'Dan zahvalnosti', | ||
'toussaint' => 'Toussaint', | ||
'vacation-day' => 'Praznik dela', | ||
'vacation-next-day' => 'Praznik dela naslednji dan', | ||
'victory-1945' => 'Zmaga 1945', | ||
); |
This file contains 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
This file contains 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
This file contains 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