From 8b55b570867d50a3109b98bc59d69fa9cadcb0d4 Mon Sep 17 00:00:00 2001 From: "Shane F. Carr" Date: Mon, 4 Nov 2024 19:26:10 -0800 Subject: [PATCH] I think this might work? --- components/datetime/src/raw/neo.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/components/datetime/src/raw/neo.rs b/components/datetime/src/raw/neo.rs index 23cc76dc866..3beba8eb736 100644 --- a/components/datetime/src/raw/neo.rs +++ b/components/datetime/src/raw/neo.rs @@ -360,13 +360,21 @@ impl OverlapPatternSelectionData { pub(crate) fn select(&self, input: &ExtractedInput) -> TimePatternDataBorrowed { match self { OverlapPatternSelectionData::SkeletonDateTime { options, payload } => { - let year_style = options.year_style.unwrap_or(YearStyle::Auto); - let variant = input.resolve_year_style(year_style); + // Currently, none of the overlap patterns have a year field, + // so we can use the variant to select the time precision. + // + // We do not currently support overlap patterns with both a + // year and a time because that would involve 3*3 = 9 variants + // instead of 3 variants. + debug_assert!(matches!(options.year_style, None)); + let time_precision = options.time_precision.unwrap_or(TimePrecision::Second); + let (variant, fractional_second_digits) = + input.resolve_time_precision(time_precision); TimePatternDataBorrowed::Resolved( payload.get().get(options.length, variant), options.alignment, options.hour_cycle, - todo!("need to resolve time variant"), + fractional_second_digits, ) } }