Skip to content

Japanese extended version of carbon of the PHP datetime API

Notifications You must be signed in to change notification settings

9bo9bo/JpCarbon

 
 

Repository files navigation

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.

About

Japanese extended version of carbon of the PHP datetime API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%