krishnahimself / laravel-ad-to-bs-converter
Convert English date to Nepali date.
Installs: 2 606
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 1
Forks: 4
Open Issues: 1
Requires
- php: ^7.4|^8.0
- illuminate/contracts: ^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.3
- vimeo/psalm: ^3.11
This package is auto-updated.
Last update: 2024-10-18 04:50:51 UTC
README
This package can convert english date to nepali date.
Here is one example of what you can do:
Convert english date to nepali date. English date format to pass is (YYYY, M, D)
DateConverter::fromEnglishDate(2020, 10, 4)->toFormattedNepaliDate(); //Output: १८ असोज २०७७, आइतवार
Installation
You can install the package via composer:
composer require krishnahimself/laravel-ad-to-bs-converter
Usage
use Krishnahimself\DateConverter\DateConverter; $nepaliDate = DateConverter::fromEnglishDate(2020, 10, 4)->toNepaliDate(); //Output: 2077-6-18 $nepaliDate = DateConverter::fromEnglishDate(2020, 10, 4)->toFormattedNepaliDate(); //Output: १८ असोज २०७७, आइतवार $nepaliDate = DateConverter::fromEnglishDate(2020, 10, 4)->toNepaliDateArray(); //Output: [ 'year' => 2077, 'month' => 6, 'day' => 18, 'day_of_week' => 1, ] $nepaliDate = DateConverter::fromEnglishDate(2020, 10, 4)->toFormattedNepaliDateArray(); //Output: [ 'year' => '२०७७', 'month' => 'असोज', 'day' => '१८', 'day_of_week' => 'आइतवार', ]
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.