BalineseDate API Reference
The BalineseDate struct is the main interface for working with Balinese calendar dates. It provides access to all calendar components and holy day information.
Creating Dates
from_ymd
pub fn from_ymd(year: i32, month: u32, day: u32) -> Result<Self, BalineseDateError>
Creates a new BalineseDate from a Gregorian date (year, month, day).
from_ymd_with_boundary
pub fn from_ymd_with_boundary(year: i32, month: u32, day: u32, boundary: &DayBoundary) -> Result<Self, BalineseDateError>
Creates a new BalineseDate from a Gregorian date using an explicit day boundary. This allows customizing how the sunrise is determined (fixed hour or astronomical).
Available DayBoundary options:
Midnight- Uses Gregorian midnight (legacy behavior)FixedSunrise(hour)- Uses a fixed hour offset (e.g., 6 for 06:00 UTC)Astronomical { lat, lon }- Calculates actual astronomical sunrise for given coordinates
Calendar Components
Saka Year
pub saka_year: i32
The Saka year (lunar calendar year).
Sasih (Lunar Month)
pub sasih: Sasih
pub sasih_day: SasihDayInfo
The lunar month and day within the month.
Wewaran (Weekly Cycles)
pub saptawara: Saptawara
pub pancawara: Pancawara
pub triwara: Triwara
The various weekly cycles.
Holy Days
Rahinan
pub rahinan: Vec<Rahinan>
A vector of holy days for this date.
Special Days
pub is_purnama: bool
pub is_tilem: bool
pub is_nampih: bool
Flags for special days and months.