@@ -10,7 +10,6 @@ use crate::format::datetime::try_write_pattern_items;
10
10
use crate :: format:: neo:: * ;
11
11
use crate :: input:: ExtractedInput ;
12
12
use crate :: neo_pattern:: DateTimePattern ;
13
- use crate :: options:: preferences:: HourCycle ;
14
13
use crate :: raw:: neo:: * ;
15
14
use crate :: scaffold:: * ;
16
15
use crate :: scaffold:: {
@@ -24,6 +23,7 @@ use core::fmt;
24
23
use core:: marker:: PhantomData ;
25
24
use icu_calendar:: any_calendar:: IntoAnyCalendar ;
26
25
use icu_calendar:: AnyCalendar ;
26
+ use icu_locale_core:: preferences:: extensions:: unicode:: keywords:: HourCycle ;
27
27
use icu_provider:: prelude:: * ;
28
28
use writeable:: TryWriteable ;
29
29
@@ -243,12 +243,13 @@ where
243
243
P : ?Sized + AllFixedCalendarFormattingDataMarkers < C , FSet > ,
244
244
L : FixedDecimalFormatterLoader ,
245
245
{
246
- // TODO: Remove this when NeoOptions is gone
246
+ // TODO: Fix this when we have DateTimePreferences
247
247
let prefs = RawPreferences {
248
248
hour_cycle : locale
249
249
. get_unicode_ext ( & icu_locale_core:: extensions:: unicode:: key!( "hc" ) )
250
250
. as_ref ( )
251
- . and_then ( HourCycle :: from_locale_value) ,
251
+ . and_then ( |v| HourCycle :: try_from ( v) . ok ( ) )
252
+ . map ( crate :: fields:: Hour :: from_hour_cycle) ,
252
253
} ;
253
254
// END TODO
254
255
@@ -473,12 +474,13 @@ where
473
474
P : ?Sized + AllAnyCalendarFormattingDataMarkers < FSet > ,
474
475
L : FixedDecimalFormatterLoader + AnyCalendarLoader ,
475
476
{
476
- // TODO: Remove this when NeoOptions is gone
477
+ // TODO: Fix this when we have DateTimePreferences
477
478
let prefs = RawPreferences {
478
479
hour_cycle : locale
479
480
. get_unicode_ext ( & icu_locale_core:: extensions:: unicode:: key!( "hc" ) )
480
481
. as_ref ( )
481
- . and_then ( HourCycle :: from_locale_value) ,
482
+ . and_then ( |v| HourCycle :: try_from ( v) . ok ( ) )
483
+ . map ( crate :: fields:: Hour :: from_hour_cycle) ,
482
484
} ;
483
485
// END TODO
484
486
0 commit comments