Skip to content

khumnath/nepdate

Repository files navigation

[Read this document in Nepali नेपाली


Bikram Calendar

Executable: bikram-calendar

A desktop widget and calendar application for Bikram Sambat, built with the modern Qt 6 framework. It uses a native C++ backend for efficient system tasks.

Application in action

Image

Key Features

  • Desktop Widget & Calendar: Provides a convenient, always-on desktop widget. Clicking the widget opens a full-featured calendar window.

  • Date Calculation & Panchanga Details:

    • The calendar uses a hybrid system for date calculation:
      • Pre-computed Data: For the 90-year period from 2000 Baisakh to 2089 Chaitra, the calendar uses pre-computed official data for high accuracy. A small notification appears in the app when you are viewing dates outside of this primary range.
      • Algorithmic Calculation: For dates outside this range, it dynamically computes them using modern high-precision NASA JPL ephemeris via the Astronomy Engine (MIT License), combined with traditional Vedic rules (Drik-Siddhanta).
    • Daily Panchanga Information:
      • The main calendar view displays the Tithi for each day.
      • Clicking on a specific day reveals comprehensive details including the Tithi, Nakshatra, Yoga, Karana, Bhadra Info, and Special Events. It also shows debug information like the sun and moon's positions.

    Disclaimer on Accuracy: While the core engine uses high-precision astronomical algorithms to determine planetary positions, computational boundaries can occasionally differ by minutes compared to other traditional sources. For official or ceremonial purposes, please always consult a calendar approved by the Nepal Panchanga Nirnayak Samiti (नेपाल पञ्चाङ्ग निर्णायक समिति).

  • Customization & Themes:

    • The calendar window includes an easy-to-use switch for toggling between Light and Dark themes. Your preference is saved and restored on the next launch.
    • Right-click the widget to open a context menu where you can configure font sizes and colors.
  • State Persistence:

    • The application remembers and restores the position of the widget and the calendar window.
    • The size of the calendar window is also saved and restored automatically.
    • (See Wayland Limitations below for exceptions).
  • System Integration:

    • Uses an internal Qt C++ backend for handling system tasks like printing, managing autostart, and displaying helpful tooltips.

Compatibility

  • Framework: Built entirely on the Qt 6 framework.
  • Required Version: Requires Qt 6.0 or higher. It has been well-tested on version Qt 6.8.0 and Qt 6.9
  • Legacy Support: Please note that Qt 5 is not supported.

Wayland Support & Limitations

Due to the security design and protocols of the Wayland display server, some features behave differently:

  • Window Position: The application cannot query window coordinates on Wayland, so it cannot save or restore the position of the widget or calendar window. However, the window size is saved and restored correctly.

  • Widget Click Action: On Wayland, a click on the movable widget is interpreted by the compositor as a "drag/move" action, which prevents the click from being registered by the application.

    • Workaround: To open the calendar on Wayland, right-click the widget and select the "Open Calendar" button from the context menu.

Building From Source

This guide provides instructions for compiling the project on popular Linux distributions.


1. Install Dependencies

You must first install the necessary build tools and libraries for your specific operating system.

For Debian / Ubuntu

First, update your package list, then install the essential build tools and Qt 6 development packages.

Install build-time dependencies

    sudo apt update
    sudo apt install build-essential \
    qt6-base-dev \
    qt6-declarative-dev \
    qt6-declarative-dev-tools \
    qt6-tools-dev \
    qt6-tools-dev-tools \
    qt6-shadertools-dev \
    libqt6printsupport6 \
    qml6-module-qtquick-controls \
    qml6-module-qtquick-layouts \
    qml6-module-qtquick-window \
    qml6-module-qtcore
   

Install runtime dependencies

    sudo apt update
    sudo apt install libqt6core6 \
    libqt6gui6 \
    libqt6qml6 \
    libqt6quick6 \
    libqt6printsupport6 \
    qml6-module-qtquick-controls \
    qml6-module-qtquick-controls2 \
    qml6-module-qtquick-layouts \
    qml6-module-qtquick-window
   

For Arch Linux

Ensure your system is up-to-date. Install the base-devel group (if you haven't already) and the required Qt 6 packages.

Synchronize package databases and update the system

sudo pacman -Syu

# Install build-time dependencies
sudo pacman -S base-devel qt6-base qt6-declarative qt6-shadertools qt6-tools

Install runtime dependencies(for pre-built binaries only)

sudo pacman -S qt6-base qt6-declarative

Note: If you encounter build errors, double-check that all the listed dependencies have been installed successfully.

  • runtime dependencies should install with build dependencies. if downloaded prebuilt binary install runtime libraries only.

2. Compilation Instructions

Once the dependencies are installed, you can compile the project using one of the following methods.

Method A: Using Qt Creator (Recommended)

This is the most straightforward method for building the project.

  1. Open the .pro file in Qt Creator.

  2. Configure the project kit if prompted.

  3. Click the Build button (or press Ctrl+B) and then the Run button (or press Ctrl+R).

Method B: Using qmake (Command Line)

  1. Navigate to the project's root directory.

  2. Create and enter a build directory:

    mkdir build && cd build
    
  3. Generate the Makefile using qmake6.

    # Note: On some older systems, you might need to use 'qmake' instead of 'qmake6'.
    qmake6 ..
    
  4. Compile the source code:

    make
    
  5. The compiled executable will be located in the build directory.

Method C: Using CMake (Command Line)

  1. Navigate to the project's root directory.

  2. Create and enter a build directory:

    mkdir build && cd build
    
  3. Generate the build files with CMake:

    cmake ..
    
  4. Compile the source code:

    make
    
  5. The compiled executable will be located in the build directory.


3. Running Tests

We use CTest to rigorously verify the accuracy of the calendar's astronomical and date conversion algorithms. The automated test compares the dynamically computed Panchanga data against a verified JSON baseline (tests/test-data.json).

To run the test suite after building:

cd build
make test
# OR use ctest directly for detailed output
ctest --output-on-failure

Changing the Test Date or Baseline

If you need to test the logic against a different date, the test executable accepts command-line arguments. You can pass a specific date, and if you want to officially update the test-data.json baseline for future tests, you can pass the --generate flag:

# Verify logic against the baseline for a specific date (defaults to 2024-06-14)
./build/run_test 2026-05-27

# Generate new baseline JSON data for a specific date (overwrites tests/test-data.json)
./build/run_test 2026-05-27 --generate

Dual Licensing & Commercial Use

This project is released under the GNU General Public License v3.0 (GPLv3) for open-source use. If you wish to use, modify, or embed the NepDate engine in a proprietary or closed-source application without adhering to the terms of the GPL, a commercial license is available. Please contact the repository owner for commercial licensing options.

Related Projects

The core calculation engine of NepDate is also available in modern Web and Android applications.

  • Web App Source Code: The React-based web application is maintained in a separate repository (or branch).
  • Android App: Available on the Google Play Store as "NepDate".

Contributing

Contributions are welcome! If you have a suggestion or want to report a bug, please feel free to open an issue.

If you would like to contribute code, please follow these steps:

  1. Fork the repository.

  2. Create a new branch (git checkout -b feature/your-feature-name).

  3. Make your changes and commit them (git commit -m 'Add some feature').

  4. Push to the branch (git push origin feature/your-feature-name).

  5. Open a Pull Request.

Acknowledgments

  • Astronomy Engine: Used for high-precision astronomical calculations. The C library is created by Don Cross and is licensed under the MIT License.

License

This project is licensed under the GNU General Public License v3.0 or later. See the LICENSE file for more details.

About

nepali date desktop widget similar to conky and nepali calendar application using Qt framework. calendar in javascript available on https://nepdate.khumnath.com.np

Topics

Resources

License

Stars

Watchers

Forks

Contributors