Skip to content

Commit b886706

Browse files
Remove HijriSimulated from DTF (#6400)
#6330
1 parent 046d67e commit b886706

File tree

6 files changed

+20
-34
lines changed

6 files changed

+20
-34
lines changed

components/calendar/src/any_calendar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ impl AnyCalendarKind {
781781
} else if region == Some(region!("AF")) || region == Some(region!("IR")) {
782782
AnyCalendarKind::Persian
783783
} else if region == Some(region!("SA")) && algo == Some(CalendarAlgorithm::Hijri(None)) {
784-
AnyCalendarKind::HijriSimulatedMecca
784+
AnyCalendarKind::HijriUmmAlQura
785785
} else {
786786
AnyCalendarKind::Gregorian
787787
}

components/datetime/src/external_loaders.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ where
106106
P: DataProvider<icu_calendar::provider::CalendarJapaneseModernV1>
107107
+ DataProvider<icu_calendar::provider::CalendarChineseV1>
108108
+ DataProvider<icu_calendar::provider::CalendarDangiV1>
109-
+ DataProvider<icu_calendar::provider::CalendarHijriSimulatedMeccaV1>
110109
+ DataProvider<icu_calendar::provider::CalendarHijriUmmalquraV1>
111110
+ ?Sized,
112111
{

components/datetime/src/scaffold/calendar.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ pub(crate) enum FormattableAnyCalendarKind {
284284
Hebrew,
285285
Indian,
286286
HijriTabularCivil,
287-
HijriSimulatedMecca,
287+
// _NOT_ HijriSimulatedMecca
288288
HijriTabularAstronomical,
289289
HijriUmmAlQura,
290290
Japanese,
@@ -307,7 +307,7 @@ impl FormattableAnyCalendarKind {
307307
Hebrew => Self::Hebrew,
308308
Indian => Self::Indian,
309309
HijriTabularCivil => Self::HijriTabularCivil,
310-
HijriSimulatedMecca => Self::HijriSimulatedMecca,
310+
HijriSimulatedMecca => return None,
311311
HijriTabularAstronomical => Self::HijriTabularAstronomical,
312312
HijriUmmAlQura => Self::HijriUmmAlQura,
313313
Iso => return None,
@@ -332,7 +332,7 @@ impl FormattableAnyCalendarKind {
332332
}
333333
}
334334
// Calendar not specified or not supported by DateTimeFormatter
335-
// Currently this is CalendarAlgorithm::Iso8601
335+
// Currently this is CalendarAlgorithm::Iso8601, CalendarAlgorithm::Hijri(Rgsa)
336336
// Let AnyCalendarKind constructor select an appropriate fallback
337337
prefs.calendar_algorithm = None;
338338
let kind = AnyCalendarKind::new((&prefs).into());
@@ -393,7 +393,6 @@ impl FormattableAnyCalendar {
393393
HijriTabularCivil => {
394394
AnyCalendar::HijriTabularCivil(cal::HijriTabular::new_civil_epoch())
395395
}
396-
HijriSimulatedMecca => AnyCalendar::HijriSimulated(cal::HijriSimulated::new_mecca()),
397396
HijriTabularAstronomical => {
398397
AnyCalendar::HijriTabularAstronomical(cal::HijriTabular::new_astronomical_epoch())
399398
}
@@ -429,9 +428,6 @@ impl FormattableAnyCalendar {
429428
HijriTabularCivil => {
430429
AnyCalendar::HijriTabularCivil(cal::HijriTabular::new_civil_epoch())
431430
}
432-
HijriSimulatedMecca => AnyCalendar::HijriSimulated(
433-
cal::HijriSimulated::try_new_mecca_with_buffer_provider(provider)?,
434-
),
435431
HijriTabularAstronomical => {
436432
AnyCalendar::HijriTabularAstronomical(cal::HijriTabular::new_astronomical_epoch())
437433
}
@@ -456,7 +452,6 @@ impl FormattableAnyCalendar {
456452
+ DataProvider<icu_calendar::provider::CalendarJapaneseModernV1>
457453
+ DataProvider<icu_calendar::provider::CalendarChineseV1>
458454
+ DataProvider<icu_calendar::provider::CalendarDangiV1>
459-
+ DataProvider<icu_calendar::provider::CalendarHijriSimulatedMeccaV1>
460455
+ DataProvider<icu_calendar::provider::CalendarHijriUmmalquraV1>,
461456
{
462457
use FormattableAnyCalendarKind::*;
@@ -475,9 +470,6 @@ impl FormattableAnyCalendar {
475470
HijriTabularCivil => {
476471
AnyCalendar::HijriTabularCivil(cal::HijriTabular::new_civil_epoch())
477472
}
478-
HijriSimulatedMecca => {
479-
AnyCalendar::HijriSimulated(cal::HijriSimulated::try_new_mecca_unstable(provider)?)
480-
}
481473
HijriTabularAstronomical => {
482474
AnyCalendar::HijriTabularAstronomical(cal::HijriTabular::new_astronomical_epoch())
483475
}
@@ -574,7 +566,7 @@ where
574566
Gregorian => H::Gregorian::bind(p).load_bound(req),
575567
Hebrew => H::Hebrew::bind(p).load_bound(req),
576568
Indian => H::Indian::bind(p).load_bound(req),
577-
HijriTabularCivil | HijriTabularAstronomical | HijriSimulatedMecca | HijriUmmAlQura => {
569+
HijriTabularCivil | HijriTabularAstronomical | HijriUmmAlQura => {
578570
H::Hijri::bind(p).load_bound(req)
579571
}
580572
Japanese => H::Japanese::bind(p).load_bound(req),
@@ -593,9 +585,7 @@ where
593585
Gregorian => H::Gregorian::INFO,
594586
Hebrew => H::Hebrew::INFO,
595587
Indian => H::Indian::INFO,
596-
HijriTabularCivil | HijriTabularAstronomical | HijriSimulatedMecca | HijriUmmAlQura => {
597-
H::Hijri::INFO
598-
}
588+
HijriTabularCivil | HijriTabularAstronomical | HijriUmmAlQura => H::Hijri::INFO,
599589
Japanese => H::Japanese::INFO,
600590
Persian => H::Persian::INFO,
601591
Roc => H::Roc::INFO,

components/datetime/src/scaffold/fieldset_traits.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ use crate::{
88
};
99
use icu_calendar::{
1010
provider::{
11-
CalendarChineseV1, CalendarDangiV1, CalendarHijriSimulatedMeccaV1,
12-
CalendarHijriUmmalquraV1, CalendarJapaneseModernV1,
11+
CalendarChineseV1, CalendarDangiV1, CalendarHijriUmmalquraV1, CalendarJapaneseModernV1,
1312
},
1413
types::{DayOfMonth, DayOfYear, MonthInfo, Weekday, YearInfo},
1514
Date, Iso,
@@ -508,7 +507,6 @@ impl<T> AllFixedCalendarExternalDataMarkers for T where
508507
pub trait AllAnyCalendarExternalDataMarkers:
509508
DataProvider<CalendarChineseV1>
510509
+ DataProvider<CalendarDangiV1>
511-
+ DataProvider<CalendarHijriSimulatedMeccaV1>
512510
+ DataProvider<CalendarHijriUmmalquraV1>
513511
+ DataProvider<CalendarJapaneseModernV1>
514512
+ DataProvider<DecimalSymbolsV1>
@@ -520,7 +518,6 @@ impl<T> AllAnyCalendarExternalDataMarkers for T where
520518
T: ?Sized
521519
+ DataProvider<CalendarChineseV1>
522520
+ DataProvider<CalendarDangiV1>
523-
+ DataProvider<CalendarHijriSimulatedMeccaV1>
524521
+ DataProvider<CalendarHijriUmmalquraV1>
525522
+ DataProvider<CalendarJapaneseModernV1>
526523
+ DataProvider<DecimalSymbolsV1>

components/datetime/tests/datetime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ fn assert_fixture_element<C>(
248248

249249
if matches!(
250250
input.date.calendar().kind(),
251-
AnyCalendarKind::JapaneseExtended
251+
AnyCalendarKind::JapaneseExtended | AnyCalendarKind::HijriSimulatedMecca
252252
) {
253253
// Not supported with FormattableAnyCalendar
254254
return;

ffi/dart/test/icu_test.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ void main() {
9595
VariantOffsetsCalculator(),
9696
);
9797

98-
var locale = Locale.fromString('de-u-ca-islamic-rgsa');
98+
var locale = Locale.fromString('de-u-ca-islamic-umalqura');
9999

100100
///// DateFormatter /////
101101
102-
expect(DateFormatter.md(locale).formatIso(zonedDateTimeIso.date), '14.07.');
102+
expect(DateFormatter.md(locale).formatIso(zonedDateTimeIso.date), '15.07.');
103103

104104
///// TimeFormatter /////
105105
@@ -117,7 +117,7 @@ void main() {
117117
DateTimeFormatter.ymdet(
118118
locale,
119119
).formatIso(zonedDateTimeIso.date, zonedDateTimeIso.time),
120-
'Mi., 14. Raj. 1446 AH, 14:32:12',
120+
'Mi., 15. Raj. 1446 AH, 14:32:12',
121121
);
122122

123123
expect(
@@ -126,7 +126,7 @@ void main() {
126126
length: DateTimeLength.long,
127127
timePrecision: TimePrecision.minute,
128128
).formatIso(zonedDateTimeIso.date, zonedDateTimeIso.time),
129-
'Mittwoch, 14. Radschab 1446 AH, 14:32',
129+
'Mittwoch, 15. Radschab 1446 AH, 14:32',
130130
);
131131

132132
expect(
@@ -136,7 +136,7 @@ void main() {
136136
),
137137
throwsA(
138138
DateTimeMismatchedCalendarError(
139-
thisKind: CalendarKind.hijriSimulatedMecca,
139+
thisKind: CalendarKind.hijriUmmAlQura,
140140
dateKind: CalendarKind.buddhist,
141141
),
142142
),
@@ -145,19 +145,19 @@ void main() {
145145
expect(
146146
DateTimeFormatter.ymdet(locale).formatSameCalendar(
147147
zonedDateTimeBuddhist.date.toCalendar(
148-
Calendar(CalendarKind.hijriSimulatedMecca),
148+
Calendar(CalendarKind.hijriUmmAlQura),
149149
),
150150
zonedDateTimeBuddhist.time,
151151
),
152-
'Do., 25. Raj. 1447 AH, 05:32:12',
152+
'Do., 26. Raj. 1447 AH, 05:32:12',
153153
);
154154

155155
expect(
156156
DateTimeFormatter.ymdet(locale).formatIso(
157157
zonedDateTimeBuddhist.date.toIso(),
158158
zonedDateTimeBuddhist.time,
159159
),
160-
'Do., 25. Raj. 1447 AH, 05:32:12',
160+
'Do., 26. Raj. 1447 AH, 05:32:12',
161161
);
162162

163163
///// DateTimeFormatterGregorian /////
@@ -192,7 +192,7 @@ void main() {
192192
locale,
193193
DateFormatter.md(locale),
194194
).formatIso(zonedDateTimeIso.date, zonedDateTimeIso.zone),
195-
'14.07. Mitteleuropäische Zeit',
195+
'15.07. Mitteleuropäische Zeit',
196196
);
197197

198198
expect(
@@ -229,7 +229,7 @@ void main() {
229229
zonedDateTimeIso.time,
230230
zonedDateTimeIso.zone,
231231
),
232-
'Mi., 14. Raj. 1446 AH, 14:32:12 Mitteleuropäische Zeit',
232+
'Mi., 15. Raj. 1446 AH, 14:32:12 Mitteleuropäische Zeit',
233233
);
234234

235235
expect(
@@ -253,7 +253,7 @@ void main() {
253253
zonedDateTimeIso.time,
254254
zonedDateTimeIso.zone,
255255
),
256-
'14. Radschab 1446 AH, 14:32:12 MEZ',
256+
'15. Radschab 1446 AH, 14:32:12 MEZ',
257257
);
258258

259259
expect(
@@ -265,7 +265,7 @@ void main() {
265265
zonedDateTimeIso.time,
266266
zonedDateTimeIso.zone,
267267
),
268-
'14.07.46 AH, 14:32:12 MEZ',
268+
'15.07.46 AH, 14:32:12 MEZ',
269269
);
270270

271271
///// ZonedDateTimeFormatterGregorian /////

0 commit comments

Comments
 (0)