Skip to content

Commit 09770d6

Browse files
Manishearthsffc
andauthored
Rename LeapBase to Base (#7778)
Fixes #7691 ## Changelog: N/A Change to unreleased API --------- Co-authored-by: Shane F. Carr <shane@unicode.org>
1 parent d77c929 commit 09770d6

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

components/calendar/src/cal/east_asian_traditional.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ impl<R: Rules> Calendar for EastAsianTraditional<R> {
793793
fn month(&self, date: &Self::DateInner) -> types::MonthInfo {
794794
let mut m = types::MonthInfo::new(self, date.0);
795795
if date.0.year().packed.leap_month() == Some(m.ordinal + 1) {
796-
m.leap_status = types::LeapStatus::LeapBase;
796+
m.leap_status = types::LeapStatus::Base;
797797
}
798798
m
799799
}

components/calendar/src/cal/hebrew.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use calendrical_calculations::rata_die::RataDie;
4646
///
4747
/// In leap years (years 3, 6, 8, 11, 17, 19 in a 19-year cycle), the leap month Adar I (`M05L`, 30 days)
4848
/// is inserted before Adar (`M06`), which is then called Adar II ([`MonthInfo::leap_status`] will be
49-
/// [`LeapStatus::LeapBase`] to mark this).
49+
/// [`LeapStatus::Base`] to mark this).
5050
///
5151
/// Standard years thus have 353-355 days, and leap years 383-385.
5252
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, PartialOrd, Ord, Default)]
@@ -359,7 +359,7 @@ impl Calendar for Hebrew {
359359
// Even though the leap month is modeled as M05L,
360360
// the actual leap base is M06.
361361
if m.number() == 6 && m.ordinal == 7 {
362-
m.leap_status = LeapStatus::LeapBase;
362+
m.leap_status = LeapStatus::Base;
363363
#[allow(deprecated)]
364364
{
365365
// This is an ICU4X invention, it's not needed by

components/calendar/src/types.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,18 +523,18 @@ pub struct Month {
523523
#[non_exhaustive]
524524
#[derive(Copy, Clone, Debug, PartialEq, Hash, Eq)]
525525
pub enum LeapStatus {
526-
/// Not a leap month.
526+
/// Not a leap month, aka a "normal", "common", "ordinary", or "standard" month.
527527
Normal,
528528
/// A leap month.
529529
Leap,
530-
/// A standard month that has a corresponding leap month
530+
/// A normal month that has a corresponding leap month
531531
/// in the same year.
532532
///
533533
/// "Corresponding" is used in a formatting sense here:
534534
/// even though the Hebrew "Adar I" is `M05L`, the
535535
/// `LeapBase` will be `M06` (not `M05`), so formatting
536536
/// knows to produce "Adar II".
537-
LeapBase,
537+
Base,
538538
}
539539

540540
impl Month {

components/datetime/src/pattern/names.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3787,8 +3787,7 @@ impl RawDateTimeNamesBorrowed<'_> {
37873787
let num_months = leap_linear.len() / 2;
37883788
if month.leap_status() == LeapStatus::Leap {
37893789
leap_linear.get(month_index + num_months)
3790-
} else if month.leap_status() == LeapStatus::LeapBase
3791-
&& month.number() < month.ordinal
3790+
} else if month.leap_status() == LeapStatus::Base && month.number() < month.ordinal
37923791
{
37933792
// Detects Hebrew (base after leap) vs Chinese (base before leap).
37943793
// In Hebrew, we use leap names for LeapBase months.
@@ -3819,7 +3818,7 @@ impl RawDateTimeNamesBorrowed<'_> {
38193818
normal_name,
38203819
SinglePlaceholderPattern::from_ref_store(&data[data.len() - 2]).ok()?,
38213820
),
3822-
LeapStatus::LeapBase => MonthPlaceholderValue::StringPattern(
3821+
LeapStatus::Base => MonthPlaceholderValue::StringPattern(
38233822
normal_name,
38243823
SinglePlaceholderPattern::from_ref_store(&data[data.len() - 1]).ok()?,
38253824
),

0 commit comments

Comments
 (0)