0.0
No commit activity in last 3 years
No release in over 3 years
Class Quarter for handling with the division of a calendar year into an arbitrary grouping of quarters, by default, the US fiscal calendar.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.1.1

Runtime

~> 0.1.1
 Project Readme

QuarterSystem¶ ↑

Currently the types of quarters are hardcoded but it shouldn’t be tough to expand the kinds of quarter systems you wish to define for your specific project. By default the gem sets up the US fiscal calendar’s definition of quarters (October-December, January-March, April-June, and July-September).

Usage¶ ↑

gem 'quarter_system', '~> 0.1.2', :git => 'git://github.com/caleon/quarter_system.git'

Quarter.general()¶ ↑

Calling Quarter.general(n) where n refers to the n’th quarter of this particular year returns the Quarter object (which is a subclass of Range with a begin and end date). The boundary dates are of a subclass QuarterBoundaryDate.

If n exceeds the number of quarters in the current system, it will cycle so that in a system with 4 quarters, Quarter.general(1) is the same as Quarter.general(5) or Quarter.general(4n+1).

Quarter.specific()¶ ↑

On the other hand, Quarter.specific(n) where n exceeds the number of quarters will increment or decrement the year as required, so Quarter.specific(20) is a call for the value of the Quarter object which is the 20th quarter from the current calendar year.

Quarter.current()¶ ↑

Quarter.current simply returns the Quarter object which contains the current date, and Quarter.current_number returns the numeric value of the current quarter in the quarter system (i.e. 1 for 1st quarter of the year).

Additional information¶ ↑

Contributors¶ ↑

We have a short list of valued contributors. Check them all at:

github.com/caleon/quarter_system/contributors

Maintainers¶ ↑

License¶ ↑

MIT License. Copyright 2011 caleon.