Socket
Book a DemoInstallSign in
Socket

quarter_system

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quarter_system

0.1.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

= 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

=== 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:

http://github.com/caleon/quarter_system/contributors

=== Maintainers

== License

MIT License. Copyright 2011 caleon.

FAQs

Package last updated on 16 Nov 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.