2017 © Pedro Peláez
 

package malaysiaholiday

to get all holidays date in malaysia

image

afiqiqmal/malaysiaholiday

to get all holidays date in malaysia

  • Sunday, June 3, 2018
  • by afiqiqmal
  • Repository
  • 2 Watchers
  • 8 Stars
  • 918 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 10 Versions
  • 2 % Grown

The README.md

Malaysia Holidays :airplane:

Parsing Malaysian Public Holidays, (*1)

Build Status Coverage Packagist Packagist Donate, (*2)

, (*3)

How to Use :sparkles:

Declare, (*4)

$holiday = new MalaysiaHoliday;
MalaysiaHoliday::make();
app(MalaysiaHoliday::class); // if bound with laravel refer here - https://laravel.com/docs/8.x/container#contextual-binding

Holidays in current year, (*5)

$holiday = new MalaysiaHoliday; // MalaysiaHoliday::make()
$holiday->fromAllState()->get();
MalaysiaHoliday::make()->fromAllState()->get();

Holidays in specific years, (*6)

$holiday = new MalaysiaHoliday;
$holiday->fromAllState(2017)->get();
$holiday->fromAllState([2017, 2019])->get();
$holiday->fromAllState()->ofYear(2017)->get();
MalaysiaHoliday::make()->fromAllState()->ofYear(2017)->get();

Holidays by region, (*7)

$holiday = new MalaysiaHoliday;
$holiday->fromState("Selangor")->get();
$holiday->fromState(["Selangor","Malacca"])->get();

Holidays by region and year, (*8)

$holiday = new MalaysiaHoliday;
$holiday->fromState("Selangor","2017")->get();
$holiday->fromState("Selangor", [2017, 2019])->get();
$holiday->fromState(["Selangor","Malacca"], [2017, 2019])->get();
$holiday->fromState(["Selangor","Malacca"])->ofYear([2017, 2019])->get();

Group and filter results, (*9)

$holiday = new MalaysiaHoliday;
$holiday->fromAllState()->groupByMonth()->get();
$holiday->fromAllState()->filterByMonth("January")->get();  //date('F')

Requirements

PHP 7.0 and above (because 5.6 is too old 😝), (*10)

To install

run, (*11)

composer require afiqiqmal/malaysiaholiday, (*12)

Sample

{
   "status":true,
   "data":[
      {
         "regional":"Selangor",
         "collection":[
            {
               "year":2019,
               "data":[
                  {
                     "day":"Tuesday",
                     "date":"2019-01-01",
                     "date_formatted":"01 January 2019",
                     "month":"January",
                     "name":"New Year's Day",
                     "description":"Regional Holiday",
                     "is_holiday":true,
                     "type":"Regional Holiday",
                     "type_id":4
                  },
                  {
                     "day":"Monday",
                     "date":"2019-01-21",
                     "date_formatted":"21 January 2019",
                     "month":"January",
                     "name":"Thaipusam",
                     "description":"Regional Holiday",
                     "is_holiday":true,
                     "type":"Regional Holiday",
                     "type_id":4
                  }
               ]
            }
         ]
      },
      {
         "regional":"Johor",
         "collection":[
            {
               "year":2019,
               "data":[
                  {
                     "day":"Monday",
                     "date":"2019-01-21",
                     "date_formatted":"21 January 2019",
                     "month":"January",
                     "name":"Thaipusam",
                     "description":"Regional Holiday",
                     "is_holiday":true,
                     "type":"Regional Holiday",
                     "type_id":4
                  }
               ]
            }
         ]
      }
   ],
   "developer":{
      "name":"Hafiq",
      "email":"hafiqiqmal93@gmail.com",
      "github":"https://github.com/afiqiqmal"
   }
}

Source :date:

Scraped from - http://www.officeholidays.com/countries/malaysia, (*13)

MIT Licence

Copyright © 2017 @afiqiqmal, (*14)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:, (*15)

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., (*16)

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE., (*17)


, (*18)

, (*19)

The Versions

03/06 2018

dev-master

9999999-dev

to get all holidays date in malaysia

  Sources   Download

MIT

The Requires

 

The Development Requires

php

31/01 2018

1.1.0

1.1.0.0

to get all holidays date in malaysia

  Sources   Download

MIT

The Requires

 

The Development Requires

php

31/10 2017

1.0.5

1.0.5.0

to get all holidays date in malaysia

  Sources   Download

MIT

The Requires

 

php

26/10 2017

dev-readme

dev-readme

to get all holidays date in malaysia

  Sources   Download

MIT

The Requires

 

php

26/10 2017

1.0.4

1.0.4.0

to get all holidays date in malaysia

  Sources   Download

MIT

The Requires

 

php

26/10 2017

dev-dev

dev-dev

to get all holidays date in malaysia

  Sources   Download

MIT

The Requires

 

php

16/06 2017

1.0.3

1.0.3.0

to get all holidays date in malaysia

  Sources   Download

MIT

The Requires

 

php

09/06 2017

1.0.2

1.0.2.0

to get all holidays date in malaysia

  Sources   Download

MIT

The Requires

 

php

09/06 2017

1.0.1

1.0.1.0

to get all holidays date in malaysia

  Sources   Download

MIT

The Requires

 

php

09/06 2017

1.0.0

1.0.0.0

to get all holidays date in malaysia

  Sources   Download

MIT

The Requires

 

php