Skip to content

Calculates the last working day of a month, which is usually pay day

License

Notifications You must be signed in to change notification settings

the-pulli/pay-day

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PayDay

CI

Provides a class PayDay\View. This class generates the pay days for the given year(s).

Installation

Install the package and add it to the application's composer.json by executing:

$ composer require pulli/pay-day

Usage

<?php
// Get the pay days
PayDay\View::create(2023)->payDays(); // return Illuminate\Support\Collection with the pay days
PayDay\View::create('2023')->payDays(); // accept String as input
PayDay\View::create(2023, 2024)->payDays(); // accept multiple years
PayDay\View::create([2023])->payDays(); // accept Array's as input
PayDay\View::create('2023-2024')->payDays(); // accept String ranges
PayDay\View::create(range(2023, 2024))->payDays(); // accept Range as input
PayDay\View::create(range(2023, 2024), 2025, '2026')->payDays(); // accept a mix of all of them

// Last parameter defines the options if set
// shows 2023 twice in the list of pay_days, default is false
PayDay\View::create(range(2023, 2024), 2023, ['duplicates' => true])->payDays();

pay_day executable supports the following options:

Option Negated Shortcut Default
--ascii --no-ascii -a false
--columns -c 10
--dayname --no-dayname -e true
--duplicates --no-duplicates -d false
--footer --no-footer -f true
--header --no-header -h true
--separator --no-separator -s true
pay_day view 2023 2024 2025-2027

Fun Fact

Because I had so much fun doing this project, I implemented it in Ruby too.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/the-pulli/pay-day.

License

The package is available as open source under the terms of the MIT License.

About

Calculates the last working day of a month, which is usually pay day

Resources

License

Stars

Watchers

Forks

Languages