TemporalZ

calendarId

Returns the calendar identifier for this date-time.

Parameters

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

Source

Implementation

#
pub fn calendarId(self: PlainDateTime, allocator: std.mem.Allocator) ![]u8 {
    const calendar_ptr = abi.c.temporal_rs_PlainDateTime_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]);
}