Git Product home page Git Product logo

quarteryear's Introduction

QuarterYear

QuarterYear is a PowerShell module which makes it easier to perform quarterly (calendar/fiscal year) calculations

Installing

Download from GitHub repository

  • Download the repository from https://github.com/ryan-leap/QuarterYear
  • Unblock the zip file ((on Windows) Right Click -> Properties -> [v/] Unblock)
  • Extract the QuarterYear folder to a module path (e.g. $home\Documents\WindowsPowerShell\Modules)

Usage

# Import the module
Import-Module -Name QuarterYear

# Get the available commands
Get-Command -Module QuarterYear

# Get help
Get-Help QuarterYear

Examples

Get-QuarterYear

# Returns the quarter of the current date for the current calendar year
Get-QuarterYear

# Returns the quarter of the current date when the (fiscal) year ends June 30th
Get-QuarterYear -YearEndDate (Get-Date -Month 6 -Day 30)

Get-QuarterYearDate

# Returns the end date of the second quarter for the current calendar year
Get-QuarterYearDate -Quarter 2

# Uses the pipeline to return the end date of each quarter for the current calendar year
1,2,3,4 | Get-QuarterYearDate

# Returns the first day of each quarter for the current calendar year
1,2,3,4 | Get-QuarterYearDate -FirstDay

# Returns the end date of each quarter for the (fiscal) year specified
1,2,3,4 | Get-QuarterYearDate -YearEndDate (Get-Date -Year 2020 -Month 6 -Day 30)

# Returns the first business day of the first quarter that doesn't fall on one of the provided holidays (business blackout dates)
Get-QuarterYearDate -Quarter 1 -FirstDay -BusinessDay -BusinessBlackoutDate ((Get-Date -Month 1 -Day 1),(Get-Date -Month 12 -Day 25))

Author(s)

  • Ryan Leap - Initial work

License

Licensed under the MIT License. See LICENSE file for details.

Acknowledgments

quarteryear's People

Contributors

ryan-leap avatar

Stargazers

 avatar

Watchers

 avatar

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.