Git Product home page Git Product logo

date-cutoff-jp's Introduction

Build Status MetaCPAN Release

NAME

Date::CutOff::JP - Get the day cutoff and payday for in Japanese timezone

SYNOPSIS

use Date::CutOff::JP;
my $dco = Date::CutOff::JP->new({ cutoff => 0, late => 1, payday => 0 });
my %calculated = $dco->calc_date('2019-01-01');
print $calculated{'cutoff'}; # '2019-01-31'
print $calculated{'payday'}; # '2019-02-28'

DESCRIPTION

Date::CutOff::JP provides how to calculate the day cutoff and the payday from Japanese calendar.

You can calculate the weekday for cutoff and paying without holidays in Japan.

Constructor

new({ [cutoff => $day], [payday => $day], [late => 0||1||2] })

You may omit parameters. defaults are { cutoff => 0, payday => 0, late => 1 }

Accessor Methods

cutoff()

get/set the day cutoff in every months. 0 means the end of the month.

caution Int over 28 is denied

payday()

get/set the payday in every months. 0 means the end of the month.

caution Int over 28 is denied

late()

get/set the lateness. 0 means the cutoff and payday is at same month.

The all you can set is Int of [ 0 .. 2 ] 3 or more returns error.

Method

calc_date([$date])

You may omit the parameter. default is TODAY.

returns hash value with keys below:

  • cutoff

    The latest cutoff after $date.

  • payday

    The latest payday after $date.

  • is_over ( maybe bad key name )

    Is or not that the cutoff is pending until next month.

BUGS

SEE ALSO

Calendar::Japanese::Holiday,Date::DayOfWeek

日本の祝日YAML

LICENSE

Copyright (C) worthmine.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

worthmine [email protected]

date-cutoff-jp's People

Contributors

worthmine avatar

Stargazers

 avatar

Watchers

 avatar  avatar

date-cutoff-jp's Issues

Tests fail (with older Calendar::Japanese::Holiday?)

On some of my smokers the test suite fails:

#   Failed test 'payday for Mar.'
#   at t/01_basic.t line 19.
#          got: '2019-04-30'
#     expected: '2019-05-07'

#   Failed test 'cutoff for Apr.'
#   at t/01_basic.t line 22.
#          got: '2019-04-30'
#     expected: '2019-05-07'
# Looks like you failed 2 tests of 24.
t/01_basic.t ....................... 
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/24 subtests 
... etc ...

This seems to happen if an older version of Calendar::Japanese::Holiday is installed, that is, for versions less than 0.05.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.