#calendar #fiscal #quarters

quarterly

Rust crate containing types for handling calendar quarters

2 releases

0.1.1 Dec 20, 2023
0.1.0 Dec 20, 2023

#453 in Date and time

CDDL-1.0

9KB
81 lines

Quarterly

A simple Rust crate containing types for handling calendar quarters.

Usage

use quarterly::*;

/// Basics
let quarter = Quarter::new(QuarterNumber::Q4, 2023)
quarter.next_quarter() /// => Quarter::new(QuarterNumber::Q1, 2024)

/// String parsing
let quarter: Quarter = "Q2 2023".parse::().unwrap();
let quarter: Quarter = "q3 1994".parse::().unwrap();

Development

Clone the repo, and then run the standard cargo commands to verify the project.

cargo clippy; cargo fmt; cargo test

No runtime deps