Download the PHP package sarojsardar/laravel-nepali-date without Composer
On this page you can find all versions of the php package sarojsardar/laravel-nepali-date. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-nepali-date
Laravel Nepali Date Converter (Laravel 12+ Compatible)
A comprehensive Laravel package for converting English (Gregorian) dates to Nepali (Bikram Sambat) dates with full localization support.
🌟 Features
- ✅ Accurate Date Conversion - English to Nepali date conversion
- ✅ Extended Year Support - Supports years 2000-2100 BS (1943-2043 AD)
- ✅ Multiple Date Formats - Flexible formatting options
- ✅ Dual Numeral System - Nepali (देवनागरी) and English numerals
- ✅ Localized Month Names - Both Nepali and English month names
- ✅ Day Names - Full day names in Nepali
- ✅ Timezone Support - Asia/Kathmandu timezone
- ✅ Error Handling - Comprehensive validation and error handling
- ✅ Laravel Integration - Facade, Service Provider, and Helper functions
- ✅ Modern PHP - PHP 8.0+ with strict typing
- ✅ Laravel Compatibility - Laravel 9, 10, 11, 12 support
📦 Installation
Install the package via Composer:
The package will automatically register its service provider and facade.
🚀 Quick Start
Basic Usage
📖 Usage Guide
Helper Functions
toNepaliDate()
Convert English date to Nepali date with custom formatting:
nepaliToday()
Get today's date in Nepali:
nepaliDateArray()
Get Nepali date as an array:
Class Methods
Facade Usage
Blade Templates
🎨 Format Options
| Format | Description | Example Output |
|---|---|---|
Y |
4-digit year | २०८० |
m |
Month (01-12) | १० |
d |
Day (01-32) | ०१ |
F |
Full month name (Nepali) | पुष |
M |
Full month name (English) | Poush |
l |
Day name (Nepali) | सोमवार |
Format Examples
🌍 Localization
Nepali Months
- वैशाख (Baisakh)
- जेठ (Jestha)
- असार (Ashar)
- साउन (Shrawan)
- भदौ (Bhadra)
- असोज (Ashoj)
- कार्तिक (Kartik)
- मंसिर (Mangsir)
- पुष (Poush)
- माघ (Magh)
- फागुन (Falgun)
- चैत (Chaitra)
Nepali Days
- आइतवार (Sunday)
- सोमवार (Monday)
- मङ्गलवार (Tuesday)
- बुधवार (Wednesday)
- बिहिवार (Thursday)
- शुक्रवार (Friday)
- शनिवार (Saturday)
⚠️ Error Handling
The package throws InvalidArgumentException for:
📅 Supported Date Range
- Nepali Years: 2000 BS - 2100 BS
- English Years: 1943 AD - 2043 AD
- Reference Date: 1943-04-14 AD = 2000-01-01 BS
🔧 Advanced Usage
Custom Service Provider
If you need to customize the package behavior:
Configuration
The package works out of the box with sensible defaults:
- Timezone: Asia/Kathmandu
- Default format: Y-m-d
- Nepali numerals: Enabled by default
🧪 Testing
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📄 License
This package is open-sourced software licensed under the MIT license.
👨💻 Author
Saroj Sardar
- Email: [email protected]
- GitHub: @sarojsardar
🙏 Acknowledgments
- Thanks to the Laravel community
- Nepali calendar data sources
- Contributors and testers
Made with ❤️ for the Nepali developer community