Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion components/datetime/src/format/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,16 @@ where
(FieldSymbol::Year(Year::Cyclic), l) => {
const PART: Part = parts::YEAR_NAME;
input!(PART, Year, year = input.year);
input!(PART, YearCyclic, cyclic = year.cyclic());

let Some(cyclic) = year.cyclic() else {
return try_write_number(
PART,
w,
decimal_formatter,
year.era_year_or_related_iso().into(),
FieldLength::One,
);
};

match datetime_names.get_name_for_cyclic(l, cyclic.year) {
Ok(name) => Ok(w.with_part(PART, |w| w.write_str(name))?),
Expand Down