Provides API to resolve name day. Still under development. (currently only Slovak)
- Today and tomorrow name day according to the date
- Reverse resolving, name day date for a name
- Holy day flag
Following steps are necessary to get this library working:
-
Add
"minimum-stability": "dev"
to your composer.json, because this lib is under development -
Run
php composer.phar require webino/webino-name-day-lib:dev-develop
- PHP 5.3
// Create the name day service
$locale = 'sk_SK';
$factory = new \WebinoNameDayLib\Factory;
$nameDay = $factory->create($locale);
// Get the name day
$result = $nameDay->today();
// Holy day logic (optional)
if ($result->isHolyDay()) {
$text = 'Today is';
} else {
$text = 'Name-day today celebrating';
}
// Name day of the day
$result->getName();
// Get tomorrow name day
$result = $nameDay->tomorrow();
// Get today & tomorrow name day
$arrayOfResults = $nameDay->combo();
NameDayResult today($date = 'now')
NameDayResult tomorrow($date = 'now')
array[NameDayResult, NameDayResult] combo($date = 'now')
DateTime nameDate($name)
DateTime nearestNameDate($name)
string getName()
bool isHolyDay()
Requirements
- Linux (recommended)
- NetBeans (optional)
- Phing
- PHPUnit
Setup
-
Clone this repository and run:
phing update
Now your development environment is set.
-
Open project in the (NetBeans) IDE
Adding region names
- Look at the
\WebinoNameDayLib\Region\Sk
- It's best to extend
\WebinoNameDayLib\Region\AbstractNames
Testing
-
Run
phpunit
in the test directory -
Run
phing test
in the module directory to run the tests and code insightsNOTE: To run the code insights there are some tool requirements.
- Add Czech names
- Add other nation names
- Tests for nameDate() & nearesetNameDate()
Please, if you are interested in this library report any issues and don't hesitate to contribute.