Expand description
Convert Gregorian dates into Bengali calendar dates across multiple standards.
§Supported Standards
This crate currently models three Bengali calendar variants:
CalendarStandard::BangladeshCurrent official Bangladesh civil calendar after the 2019 revision.CalendarStandard::BangladeshLegacyEarlier fixed Bangladesh civil calendar adopted in 1987.CalendarStandard::WestBengalTraditionalTraditional solar calendar used in West Bengal and commonly used for Bengali dates in India.
When parsing CalendarStandard from text, the short aliases BD,
BD_LEGACY, WB, and IN are supported.
§Choosing A Standard
Use CalendarStandard::Bangladesh when you want the current official
Bangladesh civil calendar where Pohela Boishakh is fixed on April 14 and the
first six months have 31 days.
Use CalendarStandard::BangladeshLegacy when you need compatibility with
the older revised Bangladesh civil calendar where the first five months have
31 days.
Use CalendarStandard::WestBengalTraditional when you want the
traditional solar calendar used in West Bengal or India-focused Bengali date
contexts. This path is modeled from sidereal solar ingress rather than a
fixed civil offset, so it should not be treated as “Bangladesh plus or
minus one day.”
§Examples
use bongabdo::{Bongabdo, CalendarStandard};
let bangladesh = Bongabdo::from_ymd(2026, 4, 14, CalendarStandard::Bangladesh)?;
assert_eq!((bangladesh.year, bangladesh.month, bangladesh.day), (1433, 1, 1));
let west_bengal =
Bongabdo::from_ymd(2026, 4, 15, CalendarStandard::WestBengalTraditional)?;
assert_eq!((west_bengal.year, west_bengal.month, west_bengal.day), (1433, 1, 1));Structs§
- Bongabdo
- Represents a date in the Bengali calendar.
- Parse
Calendar Standard Error - Error returned when parsing a calendar standard string.
Enums§
- Bongabdo
Error - Errors returned by Gregorian to Bengali conversion APIs.
- Calendar
Standard - Selects which Bengali calendar standard should be used for conversion.