1. Go to this page and download the library: Download venca-x/date-cz library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
venca-x / date-cz example snippets
use VencaX;
//...
protected function beforeRender()
{
parent::beforeRender();
$this->template->addFilter('monthNameCZ', function ($dayNumber) {
$dateCZ = new VencaX\DateCZ();
return $dateCZ->getMonthName($dayNumber);
});
$this->template->addFilter('dayNameCZ', function ($dayNumber) {
$dateCZ = new VencaX\DateCZ();
return $dateCZ->getDayName($dayNumber);
});
$this->template->addFilter('dayNameShortCZ', function ($dayNumber) {
$dateCZ = new VencaX\DateCZ();
return $dateCZ->getShortDayName($dayNumber);
});
}
{$dateTime->date|date:'n'|monthNameCZ} (* month name*)
{$dateTime->date|date:'N'|dayNameCZ} (* day name*)
{$dateTime->date|date:'N'|dayNameShortCZ} (* short day name*)
$dateCZ = new VencaX\DateCZ();
echo $dateCZ->monthNameCZ($dateTime->date->format('n')); //month name
echo $dateCZ->dayNameCZ($dateTime->date->format('N')); //day name
echo $dateCZ->dayNameShortCZ($dateTime->date->format('N')); //short day name