Skip to content

Commit 6123a1d

Browse files
committed
docs
1 parent b6b00b9 commit 6123a1d

File tree

16 files changed

+102
-61
lines changed

16 files changed

+102
-61
lines changed

components/calendar/src/cal/buddhist.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ impl GregorianYears for BuddhistEra {
7474
}
7575

7676
impl Date<Buddhist> {
77-
/// Construct a new Buddhist Date.
77+
/// Construct a new Buddhist [`Date`].
7878
///
79-
/// Years are specified as BE years.
79+
/// Years are arithmetic, meaning there is a year 0 preceded by negative years, with a
80+
/// valid range of `-1,000,000..=1,000,000`.
8081
///
8182
/// ```rust
8283
/// use icu::calendar::Date;

components/calendar/src/cal/coptic.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ impl Calendar for Coptic {
234234
}
235235

236236
impl Date<Coptic> {
237-
/// Construct new Coptic Date.
237+
/// Construct new Coptic [`Date`].
238+
///
239+
/// Years are arithmetic, meaning there is a year 0 preceded by negative years, with a
240+
/// valid range of `-1,000,000..=1,000,000`.
238241
///
239242
/// ```rust
240243
/// use icu::calendar::Date;

components/calendar/src/cal/east_asian_traditional.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,9 @@ impl Rules for Korea {
489489
impl<A: AsCalendar<Calendar = KoreanTraditional>> Date<A> {
490490
/// This method uses an ordinal month, which is probably not what you want.
491491
///
492+
/// Years are arithmetic, meaning there is a year 0 preceded by negative years, with a
493+
/// valid range of `-1,000,000..=1,000,000`.
494+
///
492495
/// Use [`Date::try_new_from_codes`]
493496
#[deprecated(since = "2.1.0", note = "use `Date::try_new_from_codes`")]
494497
pub fn try_new_dangi_with_calendar(
@@ -797,6 +800,9 @@ impl<R: Rules> Calendar for EastAsianTraditional<R> {
797800
impl<A: AsCalendar<Calendar = ChineseTraditional>> Date<A> {
798801
/// This method uses an ordinal month, which is probably not what you want.
799802
///
803+
/// Years are arithmetic, meaning there is a year 0 preceded by negative years, with a
804+
/// valid range of `-1,000,000..=1,000,000`.
805+
///
800806
/// Use [`Date::try_new_from_codes`]
801807
#[deprecated(since = "2.1.0", note = "use `Date::try_new_from_codes`")]
802808
pub fn try_new_chinese_with_calendar(

components/calendar/src/cal/ethiopian.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,12 @@ impl Ethiopian {
272272
}
273273

274274
impl Date<Ethiopian> {
275-
/// Construct new Ethiopian Date.
275+
/// Construct new Ethiopian [`Date`].
276+
///
277+
/// Years are arithmetic, meaning there is a year 0 preceded by negative years, with a
278+
/// valid range of `-1,000,000..=1,000,000`.
279+
///
280+
/// Years are interpreted according to the provided `era_style`.
276281
///
277282
/// ```rust
278283
/// use icu::calendar::cal::EthiopianEraStyle;

components/calendar/src/cal/gregorian.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,10 @@ impl GregorianYears for CeBce {
118118
pub struct Gregorian;
119119

120120
impl Date<Gregorian> {
121-
/// Construct a new Gregorian Date.
121+
/// Construct a new Gregorian [`Date`].
122122
///
123-
/// Years are specified as ISO years.
123+
/// Years are arithmetic, meaning there is a year 0 preceded by negative years, with a
124+
/// valid range of `-1,000,000..=1,000,000`.
124125
///
125126
/// ```rust
126127
/// use icu::calendar::Date;

components/calendar/src/cal/hebrew.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ impl Calendar for Hebrew {
357357
impl Date<Hebrew> {
358358
/// This method uses an ordinal month, which is probably not what you want.
359359
///
360+
/// Years are arithmetic, meaning there is a year 0 preceded by negative years, with a
361+
/// valid range of `-1,000,000..=1,000,000`.
362+
///
360363
/// Use [`Date::try_new_from_codes`]
361364
#[deprecated(since = "2.1.0", note = "use `Date::try_new_from_codes`")]
362365
pub fn try_new_hebrew(

components/calendar/src/cal/hijri.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,10 @@ impl<R: Rules> Calendar for Hijri<R> {
10401040
}
10411041

10421042
impl<A: AsCalendar<Calendar = Hijri<R>>, R: Rules> Date<A> {
1043-
/// Construct new Hijri Date.
1043+
/// Construct new Hijri [`Date`].
1044+
///
1045+
/// Years are arithmetic, meaning there is a year 0 preceded by negative years, with a
1046+
/// valid range of `-1,000,000..=1,000,000`.
10441047
///
10451048
/// ```rust
10461049
/// use icu::calendar::cal::Hijri;

components/calendar/src/cal/indian.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,10 @@ impl Indian {
283283
}
284284

285285
impl Date<Indian> {
286-
/// Construct new Indian Date, with year provided in the Śaka era.
286+
/// Construct new Indian [`Date`].
287+
///
288+
/// Years are arithmetic, meaning there is a year 0 preceded by negative years, with a
289+
/// valid range of `-1,000,000..=1,000,000`.
287290
///
288291
/// ```rust
289292
/// use icu::calendar::Date;

components/calendar/src/cal/iso.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ impl GregorianYears for IsoEra {
5555
}
5656

5757
impl Date<Iso> {
58-
/// Construct a new ISO date from integers.
58+
/// Construct a new ISO [`Date`].
59+
///
60+
/// Years are arithmetic, meaning there is a year 0 preceded by negative years, with a
61+
/// valid range of `-1,000,000..=1,000,000`.
5962
///
6063
/// ```rust
6164
/// use icu::calendar::Date;

components/calendar/src/cal/japanese.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,16 @@ impl_with_abstract_gregorian!(
298298
);
299299

300300
impl Date<Japanese> {
301-
/// Construct a new Japanese Date.
301+
/// Construct a new Japanese [`Date`].
302302
///
303303
/// Years are specified in the era provided, and must be in range for Japanese
304304
/// eras (e.g. dates past April 30 Heisei 31 must be in Reiwa; "Jun 5 Heisei 31" and "Jan 1 Heisei 32"
305305
/// will not be adjusted to being in Reiwa 1 and 2 respectively)
306306
///
307307
/// However, dates may always be specified in "bce" or "ce" and they will be adjusted as necessary.
308308
///
309+
/// This function accepts years that correspond to Gregorian years in the range `-1,000,000..=1,000,000`.
310+
///
309311
/// ```rust
310312
/// use icu::calendar::cal::Japanese;
311313
/// use icu::calendar::{Date, Ref};
@@ -365,6 +367,8 @@ impl Date<JapaneseExtended> {
365367
///
366368
/// However, dates may always be specified in "bce" or "ce" and they will be adjusted as necessary.
367369
///
370+
/// This function accepts years that correspond to Gregorian years in the range `-1,000,000..=1,000,000`.
371+
///
368372
/// ```rust
369373
/// use icu::calendar::cal::JapaneseExtended;
370374
/// use icu::calendar::{Date, Ref};

0 commit comments

Comments
 (0)