PHPackages                             dipesh/calendar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. dipesh/calendar

ActiveLibrary

dipesh/calendar
===============

A PHP package that builds a complete Nepali calendar effortlessly, serving as a wrapper around the dipesh/nepali-date package. It allows users to generate and manipulate a full Nepali calendar, add events, and perform date calculations without any prior knowledge of the underlying system.

v1.0.2(1y ago)246MITPHPPHP &gt;=8.0

Since Aug 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/pokhreldipesh/calendar)[ Packagist](https://packagist.org/packages/dipesh/calendar)[ RSS](/packages/dipesh-calendar/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

[![Laravel Logo](./calendar.png)](./calendar.png)

Nepali Calendar
===============

[](#nepali-calendar)

The **Nepali Calendar** is a comprehensive PHP package for generating and managing a Nepali calendar. It acts as a wrapper for the `dipesh/nepali-date` package, enabling users to easily create a full Nepali calendar and manage events within it, all without needing extensive knowledge of the Nepali date system.

Features
--------

[](#features)

- **Comprehensive Nepali Calendar**: Generate and work with a complete Nepali calendar.
- **Event Management**: Add, update, and manage events for each day.
- **Dynamic Event Handling**: Add events using callables or arrays, allowing integration with databases or other sources.
- **Intuitive Navigation**: Simple methods for navigating months and years.

Installation
------------

[](#installation)

To install the Nepali Calendar package, use Composer:

```
composer require dipesh/calendar
```

Usage
-----

[](#usage)

### Basic Setup

[](#basic-setup)

Create a new calendar instance. By default, it initializes to the current date, but you can provide a specific date if needed.

```
use Dipesh\Calendar\Calendar;

// Create a new calendar instance with the current date
$calendar = new Calendar();

// Create a new calendar instance with a specific date
$specificDate = '2079/01/01'; // Nepali date format
$calendar = new Calendar($specificDate);
```

### Setting Events

[](#setting-events)

Add events for specific days using the `setEvent` method. You can also set multiple events at once with the `setEvents` method.

#### Adding a Single Event

[](#adding-a-single-event)

```
// Add a single event on the 1st of the month
$calendar->setEvent(1, 'New Year Celebration');
```

#### Adding Multiple Events

[](#adding-multiple-events)

You can use an associative array of events or a callable function for dynamic event setting.

```
// Define an array of events
$events = [
    14 => 'Valentine\'s Day Celebration',
    28 => 'End of Month Gathering',
];

// Set multiple events at once
$calendar->setEvents($events);
```

### Navigating the Calendar

[](#navigating-the-calendar)

Easily move through the months and years:

```
// Move to the next month
$calendar->nextMonth();

// Move to the previous month
$calendar->prevMonth();

// Move to the next year
$calendar->nextYear();

// Move to the previous year
$calendar->prevYear();
```

### Using Callbacks for Dynamic Event Fetching

[](#using-callbacks-for-dynamic-event-fetching)

Define a callable function to fetch and set events dynamically, such as from a database.

```
// Function to fetch events from a database
$fetchEvents = function ($calendarInstance, $days) {
    // Simulated database fetch
    $dbEvents = [
        5 => 'Public Holiday',
        15 => 'Community Event',
    ];

    // Add events to the calendar
    foreach ($dbEvents as $day => $event) {
        $calendarInstance->setEvent($day, $event);
    }
};

// Set events using the callback function
$calendar->setEvents($fetchEvents);
```

Example Project
---------------

[](#example-project)

To help you get started with the Nepali Calendar package, an example project is available for you to download and inspect. This project demonstrates how to implement the calendar with event management features effectively.

### Screenshot of Example Project

[](#screenshot-of-example-project)

[![Example Project Screenshot](./example.png)](./example.png)

### Download Example Project

[](#download-example-project)

You can download the example project from the following link:

[Download Example Project](https://github.com/pokhreldipesh/calendar-example)

Contributing
------------

[](#contributing)

Contributions are welcome! If you have suggestions, improvements, or bug fixes, please submit a pull request or open an issue.

License
-------

[](#license)

This package is licensed under the MIT License. For more details, see the [LICENSE](LICENSE) file.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

3

Last Release

637d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ee8158b1af2389858b1a732a76563dad4ae2a273bc324041d687d076969ac05a?d=identicon)[dipeshpokhrel](/maintainers/dipeshpokhrel)

---

Top Contributors

[![pokhreldipesh](https://avatars.githubusercontent.com/u/118336432?v=4)](https://github.com/pokhreldipesh "pokhreldipesh (6 commits)")

---

Tags

datecalendarnepali-datenepalidateNepali Calendarnepalicalendar

### Embed Badge

![Health badge](/badges/dipesh-calendar/health.svg)

```
[![Health](https://phpackages.com/badges/dipesh-calendar/health.svg)](https://phpackages.com/packages/dipesh-calendar)
```

###  Alternatives

[azuyalabs/yasumi

The easy PHP Library for calculating holidays

1.1k11.4M26](/packages/azuyalabs-yasumi)[league/period

Time range API for PHP

7335.4M21](/packages/league-period)[aeon-php/calendar

PHP type safe, immutable calendar library

2079.7M16](/packages/aeon-php-calendar)[yohang/calendr

Object Oriented calendar management

465614.1k3](/packages/yohang-calendr)[punic/punic

PHP-Unicode CLDR

1542.9M29](/packages/punic-punic)[umulmrum/holiday

A PHP library to compute holidays. It's something :-)

92342.6k1](/packages/umulmrum-holiday)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
