Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbastian committed Jan 14, 2025
1 parent 297cbf6 commit a806c1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/datetime/src/fieldsets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ macro_rules! impl_date_marker {
#[doc = concat!(" ", length_option_helper!($type_time, $sample_length), ",")]
/// )
/// .unwrap();
/// let dt = DateTime { date: Date::try_new_iso(2024, 5, 17).unwrap(), time: Time::try_new(15, 47, 50, 0).unwrap() };
/// let dt = DateTime { date: Date::try_new_gregorian(2024, 5, 17).unwrap(), time: Time::try_new(15, 47, 50, 0).unwrap() };
///
/// assert_writeable_eq!(
/// fmt.format(&dt),
Expand Down
10 changes: 5 additions & 5 deletions components/datetime/src/pattern/names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,7 @@ impl<C: CldrCalendar, FSet: DateTimeNamesMarker> TypedDateTimeNames<C, FSet> {
/// # Examples
///
/// ```
/// use icu::calendar::{Date, DateTime, Gregorian, TIme};
/// use icu::calendar::{Date, DateTime, Gregorian, Time};
/// use icu::datetime::pattern::DateTimePattern;
/// use icu::datetime::pattern::TypedDateTimeNames;
/// use icu::locale::locale;
Expand Down Expand Up @@ -1653,7 +1653,7 @@ impl<C: CldrCalendar, FSet: DateTimeNamesMarker> TypedDateTimeNames<C, FSet> {
///
/// ```
/// use icu::calendar::Gregorian;
/// use icu::calendar::Date;
/// use icu::calendar::{Date, DateTime, Time};
/// use icu::datetime::pattern::TypedDateTimeNames;
/// use icu::datetime::pattern::MonthNameLength;
/// use icu::datetime::fieldsets::enums::{DateFieldSet, CompositeDateTimeFieldSet};
Expand All @@ -1671,14 +1671,14 @@ impl<C: CldrCalendar, FSet: DateTimeNamesMarker> TypedDateTimeNames<C, FSet> {
/// // Test it with a pattern:
/// let pattern_str = "MMM d y";
/// let pattern: DateTimePattern = pattern_str.parse().unwrap();
/// let date = Date::try_new_gregorian(2023, 11, 20).unwrap();
/// assert_try_writeable_eq!(names.with_pattern_unchecked(&pattern).format(&date), "лист. 20 2023");
/// let datetime = DateTime { date: Date::try_new_gregorian(2023, 11, 20).unwrap(), time: Time::midnight() };
/// assert_try_writeable_eq!(names.with_pattern_unchecked(&pattern).format(&datetime), "лист. 20 2023");
///
/// // Convert the field set to `CompositeDateTimeFieldSet`:
/// let composite_names = names.with_fset::<CompositeDateTimeFieldSet>();
///
/// // It should still work:
/// assert_try_writeable_eq!(composite_names.with_pattern_unchecked(&pattern).format(&date), "лист. 20 2023");
/// assert_try_writeable_eq!(composite_names.with_pattern_unchecked(&pattern).format(&datetime), "лист. 20 2023");
/// ```
///
/// Converting into a narrower type is not supported:
Expand Down

0 comments on commit a806c1b

Please sign in to comment.