galek / nette-calendar
Extending DateTime for Nette framework.
Installs: 2 534
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 1
Requires
- php: >= 7.0
- nette/bootstrap: ^2.4|^3.0@dev
- nette/di: ^2.4|^3.0@dev
- nette/neon: ^2.4|^3.0@dev
- nette/utils: ^2.4|^3.0
Requires (Dev)
- nette/tester: ^1.7|^2.0
- tracy/tracy: ^2.4
This package is auto-updated.
Last update: 2024-11-06 00:42:41 UTC
README
Extend Nette\Utils\DateTime() for Nette framework
Package Installation
The best way to install Nette Calendar is using Composer:
$ composer require galek/nette-calendar
or manual edit composer.json in your project
"require": { "galek/nette-calendar": "^1.0" }
Usage
use \Galek\Utils\Calendar; $date = new Calendar(); if($date->isWorkday()){ echo "Today is workday :/"; } if($date->isHoliday()){ echo "Today is holiday :)"; } // Easter echo "Easter of this year is: ".$date->getEaster(); echo "Easter of 2020 year is: ".$date->getEaster(2020); echo "Easter Monday of this year is: ".$date->getEasterMonday(); echo "Easter Big Friday of this year is: ".$date->getBigFriday(); echo "Today or next workday:".$date->getWorkday()->format('d.m.Y'); echo "Next workday:".$date->getWorkday(true)->format('d.m.Y'); // Something for e-shops ;) $date->setShippingTime(14, 20); echo "Date for shipping to some Hour and minute:".$date->getShippingDate()->format('d.m.Y'); /** * $date->setShippingTime(14, 20); * $date->getShippingDate() * Friday 9:30 < 14:20 = Monday * Friday 14:30 > 14:20 = Wednesday (Monday send) * etc... **/
Documentation
Learn more in the documentation and czech version of documentation.
Migration and changelog 1.x -> 2.x documentation and czech version of documentation.
Future
This repository will be rewrite to https://github.com/DateTi for smallest repositories and will use more interfaces ;)