icu_calendar 
Types for dealing with dates and custom calendars.
This module is published as its own crate (icu_calendar)
and as part of the icu crate. See the latter for more details on the ICU4X project.
The [types] module has a lot of common types for dealing with dates.
[Calendar] is a trait that allows one to define custom calendars, and [Date]
can represent dates for arbitrary calendars.
The [Iso] and [Gregorian] types are implementations for the ISO and
Gregorian calendars respectively. Further calendars can be found in the [cal] module.
Most interaction with this crate will be done via the [Date] type.
Some of the algorithms implemented here are based on Dershowitz, Nachum, and Edward M. Reingold. Calendrical calculations. Cambridge University Press, 2008. with associated Lisp code found at https://github.com/EdReingold/calendar-code2.
Examples
Examples of date manipulation using Date object. Date objects are useful
for working with dates, encompassing information about the day, month, year,
as well as the calendar type.
use ;
// Creating ISO date: 1992-09-02.
let mut date_iso = try_new_iso
.expect;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
// Answering questions about days in month and year.
assert_eq!;
assert_eq!;
Example of converting an ISO date across Indian and Buddhist calendars.
use ;
use Date;
// Creating ISO date: 1992-09-02.
let mut date_iso = try_new_iso
.expect;
assert_eq!;
assert_eq!;
assert_eq!;
// Conversion into Indian calendar: 1914-08-02.
let date_indian = date_iso.to_calendar;
assert_eq!;
assert_eq!;
assert_eq!;
// Conversion into Buddhist calendar: 2535-09-02.
let date_buddhist = date_iso.to_calendar;
assert_eq!;
assert_eq!;
assert_eq!;
More Information
For more information on development, authorship, contributing etc. please visit ICU4X home page.