TemporalZ

calendarId

Returns the calendar identifier used to interpret the internal ISO 8601 date.

See: Temporal.ZonedDateTime.calendarId

Parameters

#
self:ZonedDateTime
ZonedDateTime
allocator:std.mem.Allocator
std.mem.Allocator

Source

Implementation

#
pub fn calendarId(self: ZonedDateTime, allocator: std.mem.Allocator) ![]u8 {
    const calendar_ptr = abi.c.temporal_rs_ZonedDateTime_calendar(self._inner) orelse return error.TemporalError;
    const cal_id_view = abi.c.temporal_rs_Calendar_identifier(calendar_ptr);
    return try allocator.dupe(u8, cal_id_view.data[0..cal_id_view.len]);
}