s1k3 / bangla-date
Laravel Library for converting English date to corresponding Bangla Date
Installs: 1 140
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 1
Open Issues: 0
Requires
- php: ^7.0||^8.0
README
#####Laravel Library for converting English Date to Bangla
For Installation follow the following steps:
- composer require s1k3/bangla-date
- (You may skip this step when using Laravel >= 5.5)). Navigate to the path/to/config/app.php and add to the providers array
'providers' => [ S1K3\Bangla\Date\BanglaDateServiceProvider::class ]
- Execute the following command from the command-line to publish the package's config and the default template to start generating awesome code.
php artisan vendor:publish --provider="S1K3\Bangla\Date\BanglaDateServiceProvider"
Basic Usage:
bangla_date(time()) // OUTPUT ১২ চৈত্র ১৪২৫
bangla_date(time(),"en") // OUTPUT ২৬ মার্চ ২০১৯
bangla_date(time(),"bn") // OUTPUT ১২ চৈত্র ১৪২৫
bangla_date(time(),"bn","d-m-y") // OUTPUT ১২-চৈত্র-১৪২৫
Configuration:
return [ 'hour' => 6, 'language' => 'bn', 'format' => 'd m, y' ];
property | Description |
---|---|
format | Date formatting. |
language | 'en' for english format. 'bn' for bangla format |
hour | If 0, then date will change instantly. If it's 6, date will change at 6'0 clock at the morning. Default is 6'0 clock at the morning |
Supported values for format.
property | Description |
---|---|
m | Month |
d | Day |
y | Year |