Skip to content

Latest commit

 

History

History
58 lines (39 loc) · 1.49 KB

readme.md

File metadata and controls

58 lines (39 loc) · 1.49 KB

JpCarbon

Build Status Total Downloads Latest Stable Version License

Japanese extended version of carbon of the PHP datetime API.

For Carbon < 2.0, please use 1.0 branch

Usage

<?php

require 'vendor/autoload.php';

use JpCarbon\JpCarbon;

$instance = JpCarbon::createFromDate(2017, 1, 1)->holiday;
var_dump($instance);
// => string(6) "元日"

$instance = JpCarbon::createFromDate(2017, 1, 2)->holiday;
var_dump($instance);
// => string(12) "振替休日"

$instance = JpCarbon::createFromDate(2017, 1, 3)->holiday;
var_dump($instance);
// => string(0) ""

$eto = JpCarbon::createFromDate(2017)->eto;
var_dump($eto);
// => string(3) "酉"

via Helpers

<?php

require 'vendor/autoload.php';

$instance = jp_carbon('20170101')->holiday;
var_dump($instance);
// => string(6) "元日"

Install

$ composer require enomotodev/jp-carbon

License

MIT License.