Search by

sanamhub / nepdate-patro

sanamhub

Tithi, gazetted public holidays and events for the Bikram Sambat calendar, for sanamhub/nepdate.

dev-main 2026-11-03 01:37 UTC

This package is auto-updated.

Last update: 2026-11-03 01:37:34 UTC


README

NepDate for PHP logo

nepdate-patro

sanamhub/nepdate-patro on Packagist PHP ^8.3 License: MIT

Tithi, gazetted public holidays and events for the Bikram Sambat calendar, as a separate package from the core sanamhub/nepdate. It is part of nepdate-php and the NepDate family; the data comes from the hub sanamhub/nepdate, which derives it from the C# original, NepDate.

Status: 0.2.0-rc.1 is the first release and is not tagged yet; the API may change before 0.2.0. The data is informational, not an official calendar.

Install

composer require sanamhub/nepdate-patro

The package depends on sanamhub/nepdate, so the core arrives with it. While only the release candidate exists, ask for it explicitly:

composer require "sanamhub/nepdate:^0.2@rc" "sanamhub/nepdate-patro:^0.2@rc"

Example

use NepDate\Lang;
use NepDate\NepaliDate;

use function NepDate\Patro\coverage;
use function NepDate\Patro\info;

$info = info(NepaliDate::fromBs(2081, 1, 1));
$info->tithi()->name(); // 'Panchami'
$info->tithi()->name(Lang::Ne); // 'पञ्चमी'
$info->isPublicHoliday(); // true
$info->events()[0]->name(); // 'New Year'
coverage()->start()->isoformat(); // '2077-01-01'

info() answers one day at a time and never fails: a date outside the coverage, currently BS 2077-01-01 to 2084-08-20, answers with no tithi, no holiday and no events. publicHolidays() lists every gazetted holiday in the data.

More

Topic Where
Every public name, with an example docs/API.md
The core package and the full guide sanamhub/nepdate-php
What changed in each version CHANGELOG.md
A wrong date, holiday or tithi the hub's data error form

The source lives in packages/nepdate-patro of sanamhub/nepdate-php. The sanamhub/nepdate-php-patro repository that Packagist reads is a read-only mirror of that folder, filled by the release workflow, so open issues and pull requests in sanamhub/nepdate-php instead.

License

MIT (LICENSE). Calendar and patro data from NepDate by Raju Prasai and contributors, MIT (NOTICE). Not affiliated with the Government of Nepal.