TemporalZ

calendarId

Returns the calendar identifier for this date.

Parameters

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

Source

Implementation

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