enomotodev/jp-carbon

Japanese extended version of carbon of the PHP datetime API.

2.0.7 2021-07-21 15:12 UTC

This package is auto-updated.

Last update: 2024-10-28 21:11:41 UTC


README

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.