s1k3/bangla-date

Laravel Library for converting English date to corresponding Bangla Date

1.07 2022-02-21 08:26 UTC

This package is auto-updated.

Last update: 2025-04-21 23:07:51 UTC


README

#####Laravel Library for converting English Date to Bangla

For Installation follow the following steps:

  1. composer require s1k3/bangla-date
  2. (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
]
  1. 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