@@ -63,14 +63,11 @@ use crate::{
63
63
scaffold:: * ,
64
64
} ;
65
65
use enums:: * ;
66
- use icu_calendar:: {
67
- types:: { DayOfMonth , MonthInfo , Weekday , YearInfo } ,
68
- Date , Iso ,
69
- } ;
66
+ use icu_calendar:: types:: { DayOfMonth , MonthInfo , Weekday , YearInfo } ;
70
67
use icu_provider:: marker:: NeverMarker ;
71
68
use icu_time:: {
72
- zone:: { TimeZoneVariant , UtcOffset } ,
73
- Hour , Minute , Nanosecond , Second , Time , TimeZone ,
69
+ zone:: { TimeZoneVariant , UtcOffset , ZoneNameTimestamp } ,
70
+ Hour , Minute , Nanosecond , Second , TimeZone ,
74
71
} ;
75
72
76
73
#[ cfg( doc) ]
@@ -933,8 +930,7 @@ macro_rules! impl_zone_marker {
933
930
/// # Examples
934
931
///
935
932
/// ```
936
- /// use icu::datetime::input::Date;
937
- /// use icu::datetime::input::{Time, TimeZone,TimeZoneInfo, UtcOffset};
933
+ /// use icu::datetime::input::{Date, DateTime, Time, TimeZone, TimeZoneInfo, UtcOffset};
938
934
/// use icu::datetime::NoCalendarFormatter;
939
935
/// use icu::time::zone::TimeZoneVariant;
940
936
#[ doc = concat!( "use icu::datetime::fieldsets::zone::" , stringify!( $type) , ";" ) ]
@@ -950,7 +946,7 @@ macro_rules! impl_zone_marker {
950
946
/// // Time zone info for America/Chicago in the summer
951
947
/// let zone = TimeZone(subtag!("uschi"))
952
948
/// .with_offset("-05".parse().ok())
953
- /// .at_time(( Date::try_new_iso(2022, 8, 29).unwrap(), Time::start_of_day()) )
949
+ /// .at_date_time_iso(&DateTime{ date: Date::try_new_iso(2022, 8, 29).unwrap(), time: Time::start_of_day() } )
954
950
/// .with_variant(TimeZoneVariant::Daylight);
955
951
///
956
952
/// assert_writeable_eq!(
@@ -984,7 +980,7 @@ macro_rules! impl_zone_marker {
984
980
type TimeZoneIdInput = datetime_marker_helper!( @input/timezone/id, $( $tzid_input_yes) ?) ;
985
981
type TimeZoneOffsetInput = datetime_marker_helper!( @input/timezone/offset, yes) ;
986
982
type TimeZoneVariantInput = datetime_marker_helper!( @input/timezone/variant, $( $variant_input_yes) ?) ;
987
- type TimeZoneLocalTimeInput = datetime_marker_helper!( @input/timezone/local_time, $( $localtime_input_yes) ?) ;
983
+ type TimeZoneNameTimestampInput = datetime_marker_helper!( @input/timezone/local_time, $( $localtime_input_yes) ?) ;
988
984
type EssentialsV1 = datetime_marker_helper!( @data/zone/essentials, $( $zone_essentials_yes) ?) ;
989
985
type LocationsV1 = datetime_marker_helper!( @data/zone/locations, $( $zone_locations_yes) ?) ;
990
986
type LocationsRootV1 = datetime_marker_helper!( @data/zone/locations_root, $( $zone_locations_yes) ?) ;
@@ -1281,8 +1277,7 @@ pub mod zone {
1281
1277
/// to the location format for long lengths:
1282
1278
///
1283
1279
/// ```
1284
- /// use icu::datetime::input::Date;
1285
- /// use icu::datetime::input::{Time, TimeZone, TimeZoneInfo, UtcOffset};
1280
+ /// use icu::datetime::input::{Date, DateTime, Time, TimeZone, TimeZoneInfo, UtcOffset};
1286
1281
/// use icu::calendar::Gregorian;
1287
1282
/// use icu::datetime::FixedCalendarDateTimeFormatter;
1288
1283
/// use icu::datetime::fieldsets::zone::{SpecificLong, SpecificShort};
@@ -1293,7 +1288,7 @@ pub mod zone {
1293
1288
/// // Time zone info for Europe/Istanbul in the winter
1294
1289
/// let zone = TimeZone(subtag!("trist"))
1295
1290
/// .with_offset("+02".parse().ok())
1296
- /// .at_time(( Date::try_new_iso(2022, 1, 29).unwrap(), Time::start_of_day()) )
1291
+ /// .at_date_time_iso(&DateTime{ date: Date::try_new_iso(2022, 1, 29).unwrap(), time: Time::start_of_day() } )
1297
1292
/// .with_variant(TimeZoneVariant::Standard);
1298
1293
///
1299
1294
/// let fmt = FixedCalendarDateTimeFormatter::<Gregorian, _>::try_new(
@@ -1324,7 +1319,7 @@ pub mod zone {
1324
1319
/// For example, [`TimeZoneInfo<AtTime>`] cannot be formatted.
1325
1320
///
1326
1321
/// ```compile_fail,E0271
1327
- /// use icu::datetime::input::{Date, Iso};
1322
+ /// use icu::datetime::input::{Date, DateTime, Iso};
1328
1323
/// use icu::datetime::FixedCalendarDateTimeFormatter;
1329
1324
/// use icu::datetime::fieldsets::zone::SpecificLong;
1330
1325
/// use icu::locale::{locale, subtags::subtag};
@@ -1334,7 +1329,7 @@ pub mod zone {
1334
1329
///
1335
1330
/// let datetime = DateTime { date: Date::try_new_gregorian(2024, 10, 18).unwrap(), time: Time::start_of_day() };
1336
1331
/// let time_zone_basic = TimeZone(subtag!("uschi")).with_offset("-06".parse().ok());
1337
- /// let time_zone_at_time = time_zone_basic.at_time(( datetime.date.to_iso(), datetime.time) );
1332
+ /// let time_zone_at_time = time_zone_basic.at_date_time_iso(&DateTime{ date: datetime.date.to_iso(), time: datetime.time } );
1338
1333
///
1339
1334
/// let formatter = FixedCalendarDateTimeFormatter::try_new(
1340
1335
/// locale!("en-US").into(),
@@ -1366,7 +1361,7 @@ pub mod zone {
1366
1361
/// For example, [`TimeZoneInfo<AtTime>`] cannot be formatted.
1367
1362
///
1368
1363
/// ```compile_fail,E0271
1369
- /// use icu::datetime::input::{Date, Iso};
1364
+ /// use icu::datetime::input::{Date, DateTime, Iso};
1370
1365
/// use icu::datetime::FixedCalendarDateTimeFormatter;
1371
1366
/// use icu::datetime::fieldsets::{T, zone::SpecificShort};
1372
1367
/// use icu::locale::{locale, subtags::subtag};
@@ -1376,7 +1371,7 @@ pub mod zone {
1376
1371
///
1377
1372
/// let datetime = DateTime { Date::try_new_gregorian(2024, 10, 18).unwrap(), time: Time::start_of_day() };
1378
1373
/// let time_zone_basic = TimeZone(subtag!("uschi")).with_offset("-06".parse().ok());
1379
- /// let time_zone_at_time = time_zone_basic.at_time(( datetime.date.to_iso(), datetime.time) );
1374
+ /// let time_zone_at_time = time_zone_basic.at_date_time_iso(&DateTime{ date: datetime.date.to_iso(), time: datetime.time } );
1380
1375
///
1381
1376
/// let formatter = FixedCalendarDateTimeFormatter::try_new(
1382
1377
/// locale!("en-US").into(),
@@ -1408,7 +1403,7 @@ pub mod zone {
1408
1403
/// use icu::datetime::input::Date;
1409
1404
/// use icu::datetime::NoCalendarFormatter;
1410
1405
/// use icu::datetime::fieldsets::zone::LocalizedOffsetLong;
1411
- /// use icu::datetime::input::{Time, TimeZone, UtcOffset};
1406
+ /// use icu::datetime::input::{DateTime, Time, TimeZone, UtcOffset};
1412
1407
/// use icu::time::zone::TimeZoneVariant;
1413
1408
/// use icu::locale::{locale, subtags::subtag};
1414
1409
/// use writeable::assert_writeable_eq;
@@ -1418,7 +1413,7 @@ pub mod zone {
1418
1413
///
1419
1414
/// let date = Date::try_new_iso(2024, 10, 18).unwrap();
1420
1415
/// let time = Time::start_of_day();
1421
- /// let time_zone_at_time = time_zone_basic.at_time(( date, time) );
1416
+ /// let time_zone_at_time = time_zone_basic.at_date_time_iso(&DateTime{ date, time } );
1422
1417
///
1423
1418
/// let time_zone_full = time_zone_at_time.with_variant(TimeZoneVariant::Standard);
1424
1419
///
@@ -1469,8 +1464,7 @@ pub mod zone {
1469
1464
/// When a display name is unavailable, falls back to the location format:
1470
1465
///
1471
1466
/// ```
1472
- /// use icu::datetime::input::Date;
1473
- /// use icu::datetime::input::{Time, TimeZone};
1467
+ /// use icu::datetime::input::{Date, DateTime, Time, TimeZone};
1474
1468
/// use icu::calendar::Gregorian;
1475
1469
/// use icu::datetime::FixedCalendarDateTimeFormatter;
1476
1470
/// use icu::datetime::fieldsets::zone::GenericShort;
@@ -1480,7 +1474,7 @@ pub mod zone {
1480
1474
/// // Time zone info for Europe/Istanbul
1481
1475
/// let zone = TimeZone(subtag!("trist"))
1482
1476
/// .without_offset()
1483
- /// .at_time(( Date::try_new_iso(2022, 1, 29).unwrap(), Time::start_of_day()) );
1477
+ /// .at_date_time_iso(&DateTime{ date: Date::try_new_iso(2022, 1, 29).unwrap(), time: Time::start_of_day() } );
1484
1478
///
1485
1479
/// let fmt = FixedCalendarDateTimeFormatter::<Gregorian, _>::try_new(
1486
1480
/// locale!("en").into(),
@@ -1497,8 +1491,7 @@ pub mod zone {
1497
1491
/// Can also fall back to the UTC offset:
1498
1492
///
1499
1493
/// ```
1500
- /// use icu::datetime::input::Date;
1501
- /// use icu::datetime::input::Time;
1494
+ /// use icu::datetime::input::{Date, DateTime, Time};
1502
1495
/// use icu::datetime::NoCalendarFormatter;
1503
1496
/// use icu::datetime::fieldsets::zone::GenericShort;
1504
1497
/// use icu::datetime::DateTimeWriteError;
@@ -1518,7 +1511,7 @@ pub mod zone {
1518
1511
/// let time_zone = IanaParser::new()
1519
1512
/// .parse("America/Chicago")
1520
1513
/// .with_offset("-05".parse().ok())
1521
- /// .at_time(( Date::try_new_iso(2022, 8, 29).unwrap(), Time::start_of_day()) );
1514
+ /// .at_date_time_iso(&DateTime{ date: Date::try_new_iso(2022, 8, 29).unwrap(), time: Time::start_of_day() } );
1522
1515
/// assert_writeable_eq!(
1523
1516
/// tzf.format(&time_zone),
1524
1517
/// "CT"
@@ -1528,7 +1521,7 @@ pub mod zone {
1528
1521
/// let time_zone = IanaParser::new()
1529
1522
/// .parse("Pacific/Honolulu")
1530
1523
/// .with_offset("-10".parse().ok())
1531
- /// .at_time(( Date::try_new_iso(2022, 8, 29).unwrap(), Time::start_of_day()) );
1524
+ /// .at_date_time_iso(&DateTime{ date: Date::try_new_iso(2022, 8, 29).unwrap(), time: Time::start_of_day() } );
1532
1525
/// assert_writeable_eq!(
1533
1526
/// tzf.format(&time_zone),
1534
1527
/// "HST"
@@ -1538,7 +1531,7 @@ pub mod zone {
1538
1531
/// let time_zone = IanaParser::new()
1539
1532
/// .parse("America/Chigagou")
1540
1533
/// .with_offset("-05".parse().ok())
1541
- /// .at_time(( Date::try_new_iso(2022, 8, 29).unwrap(), Time::start_of_day()) );
1534
+ /// .at_date_time_iso(&DateTime{ date: Date::try_new_iso(2022, 8, 29).unwrap(), time: Time::start_of_day() } );
1542
1535
/// assert_writeable_eq!(
1543
1536
/// tzf.format(&time_zone),
1544
1537
/// "GMT-5"
0 commit comments