PHP code example of alaa / magento2-managed-holiday

1. Go to this page and download the library: Download alaa/magento2-managed-holiday library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alaa / magento2-managed-holiday example snippets


\Alaa\ManagedHoliday\Helper\Holiday::getHoliday(string $input = null, $storeId = null)

define(['holiday'], function (holiday) {
    holiday.getHoliday(function (response) {
        // do something
    }, 1)
});

define(['holiday'], function (holiday) {
    holiday.isHoliday(function (response) {
        // do something
    }, {input: "01/01/2018"})
});

define(['holiday'], function (holiday) {
    holiday.nextHolidays(function (response) {
        // do something
    }, {})// could be store_id passed in
});

define(['holiday'], function (holiday) {
    holiday.between(function (response) {
        // do something
    }, {"from": "12/01/2018", "to": "12/29/2018"})
});