TemporalZ

era

Returns the calendar-specific era of this year-month, or null if not applicable.

See: Temporal.PlainYearMonth.era

Parameters

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

Source

Implementation

#
pub fn era(self: PlainYearMonth, allocator: std.mem.Allocator) !?[]const u8 {
    var write = abi.DiplomatWrite.init(allocator);
    defer write.deinit();

    abi.c.temporal_rs_PlainYearMonth_era(self._inner, &write.inner);
    const result = try write.toOwnedSlice();
    if (result.len == 0) return null;
    return result;
}