Git Product home page Git Product logo

alkoumi / laravel-hijri-date Goto Github PK

View Code? Open in Web Editor NEW
92.0 3.0 20.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 People

Contributors

alkoumi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

laravel-hijri-date's Issues

how can i get full month calendar

Salam Alikum,
is it possible to get a full month calendar like for example how can I get Ramadan days when it will start and when it will end,
and thank you for this great package

Add custom cast class for laravel >= 7.x

سلام عليكم ورحمة الله وبركاته

Thanks for this amazing package.
I suggest to add custom Casting to convert the dates in get or set automaticlly. as you know the dates should be stored as gregorian in storage but displayed as hijri.

for example in your model add the HijriDate cast:

    /**
     * The attributes that should be cast.
     *
     * @var array
     */
    protected $casts = [
        'created_at' => HijriDate::class,
    ];
  • HijriDate:
class HijriDate implements CastsAttributes
{
   /**
    * Cast the given value.
    *
    * @param  \Illuminate\Database\Eloquent\Model  $model
    * @param  string  $key
    * @param  mixed  $value
    * @param  array  $attributes
    * @return mixed
    */
   public function get($model, $key, $value, $attributes)
   {
       // Here convert gregorian to hijri;
       return $value;
   }

   /**
    * Prepare the given value for storage.
    *
    * @param  \Illuminate\Database\Eloquent\Model  $model
    * @param  string  $key
    * @param  array  $value
    * @param  array  $attributes
    * @return mixed
    */
   public function set($model, $key, $value, $attributes)
   {
       // Here convert hijri to gregorian;
       return $value;
   }
}

and if you add some tests it will be great 👍

Laravel 5.6 issue

Salam Alikum,
I've installed this package, but it doesn't work ! Class Hijri doesn't exist.

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.