Git Product home page Git Product logo

alkoumi / laravel-hijri-date Goto Github PK

View Code? Open in Web Editor NEW
95.0 3.0 21.0 239 KB

Laravel package to Convert laravel date to our Amazing 💝 Hjri date {ummul qura and vice versa} . to look like [ الخميس ، ٢٢ ربيع الآخر ، ١٤٤١ - ٠٧:٤٩ مساءً]

License: MIT License

PHP 100.00%
hjri date hijri-date hijri-calendar ummul-qura-calendar ummul-qura hijri-dates laravel-hijri-date

laravel-hijri-date's Introduction

Laravel Hijri Date Ummul Qura Calendar

تحويل التواريخ من و إلى التاريخ الهجري حسب تقويم أم القرى

License Total Downloads Packagist Version GitHub release (latest by date) Packagist Stars

Laravel package to Convert laravel date to our Amazing 💝 Hjri date {ummul qura and vice versa} . to look like [ الخميس ، ٢٢ ربيع الآخر ، ١٤٤١ - ٠٧:٤٩ مساءً]

Installation for all Laravel Versions 🥳

You can install the package via composer:

composer require alkoumi/laravel-hijri-date

The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php file:

'providers' => [
    // ...
    Alkoumi\LaravelHijriDate\LaravelHijriDateServiceProvider::class,
];

Usage

Tafqeet

Get Hijri Date with Ummul Qura calendar in [Your Custom Format]

You can simply get Ummul qura Hijri date directly in Your custom format using Hijri::Date() :

Hijri::Date('format','timestamp') accept tow parameters :

1- First parameter 'format' is required

2- Second parameter 'timestamp' is optianl

    // Choose Your Format Like 'l ، j F ، Y'
    // l => اليوم [الجمعة]
    // j => تاريخ اليوم الهجري [27]
    // m => رقم الشهر االهجري [09]
    // F => اسم الشهر الهجري [رمضان]
    // Y => السنة بالتاريخ الهجري [1442]
    // a => 'ص'
    // A => 'صباحًا'
    // H => الساعات
    // i => الدقائق
    // s => الثواني

    use Alkoumi\LaravelHijriDate\Hijri;

    Hijri::Date('l ، j F ، Y');                         // Without Defining Timestamp It will return Hijri Date of [NOW]  => Results "الجمعة ، 12 ربيع الآخر ، 1442"
    Hijri::Date('Y/m/d');                              // => Results "1442/04/12"
    Hijri::DateIndicDigits('l ، j F ، Y');              // Without Defining Timestamp It will return Hijri Date of [NOW] in Indic Digits => Results "الجمعة ، ١٢ ربيع الآخر ، ١٤٤٢"
    Hijri::DateIndicDigits('Y/m/d');                   //  => Results "١٤٤٢/٠٤/١٢"

    [OR]

    $date = Carbon::now()->addMonth();
    Hijri::Date('l ، j F ، Y', $date);                  // With optional Timestamp It will return Hijri Date of [$date] => Results "الأحد ، 12 جمادى الأول ، 1442"
    Hijri::Date('Y/m/d');                              // => Results "1442/04/12"
    Hijri::DateIndicDigits('l ، j F ، Y', $date);       // With optional Timestamp It will return Hijri Date of [$date] in Indic Digits => Results "الأحد ، ١٢ جمادى الأول ، ١٤٤٢"
    Hijri::DateIndicDigits('Y/m/d');                   //  => Results "١٤٤٢/٠٤/١٢"

Get Hijri Date Ummul Qura Calendar [Short Format]

You can simply get Ummul qura Hijri date directly in Short Format

Hijri::ShortDate('timestamp') accept One Optinal 'timestamp' parameter :

    use Alkoumi\LaravelHijriDate\Hijri;

    Hijri::ShortDate();                 // Without Defining Timestamp It will return Hijri Date of [NOW] => Results "1442/04/12"
    Hijri::ShortDateIndicDigits();      // Without Defining Timestamp It will return Hijri Date of [NOW] in Indic Digits => Results "١٤٤٢/٠٤/١٢"

    [OR]

    $date = Carbon::now()->addMonth();
    Hijri::ShortDate($date);                 // With optional Timestamp It will return Hijri Date of [$date] => Results "1442/05/12"
    Hijri::ShortDateIndicDigits($date);      // With optional Timestamp It will return Hijri Date of [$date] in Indic Digits => Results "١٤٤٢/٠٥/١٢"

Get Hijri Date Ummul Qura Calendar [Medium Format]

You can simply get Ummul qura Hijri date directly in Medium Format

Hijri::MediumDate('timestamp') accept One Optinal 'timestamp' parameter :

    use Alkoumi\LaravelHijriDate\Hijri;

    Hijri::MediumDate();                    // Without Defining Timestamp It will return Hijri Date of [NOW] => Results "الجمعة ، 12 ربيع الآخر ، 1442"
    Hijri::MediumDateIndicDigits();         // Without Defining Timestamp It will return Hijri Date of [NOW] in Indic Digits => Results "الجمعة ، ١٢ ربيع الآخر ، ١٤٤٢"

    [OR]

    $date = Carbon::now()->addMonth();
    Hijri::MediumDate($date);                 // With optional Timestamp It will return Hijri Date of [$date] => Results "الأحد ، 12 جمادى الأول ، 1442"
    Hijri::MediumDateIndicDigits($date);      // With optional Timestamp It will return Hijri Date of [$date] in Indic Digits => Results "الأحد ، ١٢ جمادى الأول ، ١٤٤٢"

Get Hijri Date Ummul Qura Calendar [Full Format]

You can simply get Ummul qura Hijri date directly in Full Format

Hijri::FullDate('timestamp') accept One Optinal 'timestamp' parameter :

    use Alkoumi\LaravelHijriDate\Hijri;

    Hijri::FullDate();                    // Without Defining Timestamp It will return Hijri Date of [NOW] => Results "الجمعة ، 12 ربيع الآخر ، 1442 - 12:34:25 مساءً"
    Hijri::FullDateIndicDigits();         // Without Defining Timestamp It will return Hijri Date of [NOW] in Indic Digits => Results "الجمعة ، ١٢ ربيع الآخر ، ١٤٤٢ - ١٢:٣٤:٢٥ مساءً"

    [OR]

    $date = Carbon::now()->addMonth();
    Hijri::FullDate($date);                 // With optional Timestamp It will return Hijri Date of [$date] => Results "الأحد ، 12 جمادى الأول ، 1442 - 12:34:25 مساءً"
    Hijri::FullDateIndicDigits($date);      // With optional Timestamp It will return Hijri Date of [$date] in Indic Digits => Results "الأحد ، ١٢ جمادى الأول ، ١٤٤٢ - ١٢:٣٤:٢٥ مساءً"

Give Me 💗 Cup of ☕️ Coffee here https://patreon.com/mohammadelkoumi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.