PHP code example of grei / tanggalmerah

1. Go to this page and download the library: Download grei/tanggalmerah 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/ */

    

grei / tanggalmerah example snippets


$t = new Grei\TanggalMerah("lokasi/calendar.json");

 php

 Grei\TanggalMerah();
$t->check(); # mengecek apakah tanggal merah, return boolean.
$t->is_holiday(); # mengecek apakah hari libur nasional, return  boolean.
$t->is_sunday(); # mengecek apakah hari minggu, return booelan.
$t->get_event(); # mendapatkan event, return array

 php
$t->set_date("20190205");
$t->check();
 php
$tz = new DateTimeZone("Asia/Makassar");
$t->set_timezone($tz);
$t->check();