Skip to content
Calendar component for Nette Framework
PHP JavaScript CSS HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
resources
src
.gitignore
.npmignore
LICENSE
composer.json
gulpfile.js
package.json
readme.md

readme.md

Kalendář pro Nette Framework

Použití

protected function createComponentCalendar(): \Nattreid\Calendar\Calendar
{
    $calendar = new \Nattreid\Calendar\Calendar();
    $calendar
        ->showOtherDays()
        ->showMonth()
        ->showYear()
        ->setFirstDayOfWeek(1)
        ->setNumberOfMonths(3)
        ->setFormat('Y-m-d')
        ->disableBeforeCurrent()
        ->setDisabledDays([
            (new DateTime)->modify('+ 1 day'),
            (new DateTime)->modify('+ 7 day'),
            (new DateTime)->modify('+ 8 day'),
            (new DateTime)->modify('+ 14 day'),
        ])
        ->setDayRenderer(function (Day $day) {
            return 'Day is ' . $day->day;
        })
        ->setDayTemplate(__DIR__ . '/templates/day.latte', ['foo' => 5])
        ->getTranslator()->setLang('en');

    return $calendar;
}
function parseDate(date) {
    return date.getDate() + '.' + date.getMonth() + '.' + date.getFullYear();
}

var calendar = $('#calendar').nattreidCalendar({
    onSelected: function (selected) {
        $('form input[name="from"]').val(parseDate(selected[0]));
        $('form input[name="to"]').val(parseDate(selected[1]));
    }
});

var selectedDates = calendar.getSelected();
You can’t perform that action at this time.