@@ -31,7 +31,7 @@ use tinystr::tinystr;
31
31
///
32
32
/// # Era codes
33
33
///
34
- /// This calendar uses two era codes: `gregory-inverse ` (aliases `bce`, ` bc`), and `gregory ` (aliases `ce`, `ad`), corresponding to the BCE and CE eras.
34
+ /// This calendar uses two era codes: `bce ` (alias ` bc`), and `ce ` (alias `ad`), corresponding to the BCE and CE eras.
35
35
#[ derive( Copy , Clone , Debug , Default ) ]
36
36
#[ allow( clippy:: exhaustive_structs) ] // this type is stable
37
37
pub struct Gregorian ;
@@ -50,8 +50,8 @@ impl Calendar for Gregorian {
50
50
day : u8 ,
51
51
) -> Result < Self :: DateInner , DateError > {
52
52
let year = match era {
53
- Some ( "gregory-inverse" | " bce" | "bc" ) | None => 1 - year_check ( year, 1 ..) ?,
54
- Some ( "gregory" | " ad" | "ce" ) => year_check ( year, 1 ..) ?,
53
+ Some ( "bce" | "bc" ) | None => 1 - year_check ( year, 1 ..) ?,
54
+ Some ( "ad" | "ce" ) => year_check ( year, 1 ..) ?,
55
55
Some ( _) => return Err ( DateError :: UnknownEra ) ,
56
56
} ;
57
57
@@ -111,7 +111,7 @@ impl Calendar for Gregorian {
111
111
types:: YearInfo :: new (
112
112
year,
113
113
types:: EraYear {
114
- standard_era : tinystr ! ( 16 , "gregory " ) . into ( ) ,
114
+ standard_era : tinystr ! ( 16 , "ce " ) . into ( ) ,
115
115
formatting_era : types:: FormattingEra :: Index ( 1 , tinystr ! ( 16 , "CE" ) ) ,
116
116
era_year : year,
117
117
ambiguity : match year {
@@ -126,7 +126,7 @@ impl Calendar for Gregorian {
126
126
types:: YearInfo :: new (
127
127
year,
128
128
types:: EraYear {
129
- standard_era : tinystr ! ( 16 , "gregory-inverse " ) . into ( ) ,
129
+ standard_era : tinystr ! ( 16 , "bce " ) . into ( ) ,
130
130
formatting_era : types:: FormattingEra :: Index ( 0 , tinystr ! ( 16 , "BCE" ) ) ,
131
131
era_year : 1_i32 . saturating_sub ( year) ,
132
132
ambiguity : types:: YearAmbiguity :: EraAndCenturyRequired ,
@@ -243,7 +243,7 @@ mod test {
243
243
iso_month : 1 ,
244
244
iso_day : 1 ,
245
245
expected_year : 1 ,
246
- expected_era : Era ( tinystr ! ( 16 , "gregory " ) ) ,
246
+ expected_era : Era ( tinystr ! ( 16 , "ce " ) ) ,
247
247
expected_month : 1 ,
248
248
expected_day : 1 ,
249
249
} ,
@@ -253,7 +253,7 @@ mod test {
253
253
iso_month : 6 ,
254
254
iso_day : 30 ,
255
255
expected_year : 1 ,
256
- expected_era : Era ( tinystr ! ( 16 , "gregory " ) ) ,
256
+ expected_era : Era ( tinystr ! ( 16 , "ce " ) ) ,
257
257
expected_month : 6 ,
258
258
expected_day : 30 ,
259
259
} ,
@@ -263,7 +263,7 @@ mod test {
263
263
iso_month : 2 ,
264
264
iso_day : 29 ,
265
265
expected_year : 4 ,
266
- expected_era : Era ( tinystr ! ( 16 , "gregory " ) ) ,
266
+ expected_era : Era ( tinystr ! ( 16 , "ce " ) ) ,
267
267
expected_month : 2 ,
268
268
expected_day : 29 ,
269
269
} ,
@@ -273,7 +273,7 @@ mod test {
273
273
iso_month : 9 ,
274
274
iso_day : 5 ,
275
275
expected_year : 4 ,
276
- expected_era : Era ( tinystr ! ( 16 , "gregory " ) ) ,
276
+ expected_era : Era ( tinystr ! ( 16 , "ce " ) ) ,
277
277
expected_month : 9 ,
278
278
expected_day : 5 ,
279
279
} ,
@@ -283,7 +283,7 @@ mod test {
283
283
iso_month : 3 ,
284
284
iso_day : 1 ,
285
285
expected_year : 100 ,
286
- expected_era : Era ( tinystr ! ( 16 , "gregory " ) ) ,
286
+ expected_era : Era ( tinystr ! ( 16 , "ce " ) ) ,
287
287
expected_month : 3 ,
288
288
expected_day : 1 ,
289
289
} ,
@@ -297,7 +297,7 @@ mod test {
297
297
#[ test]
298
298
fn test_gregorian_bce ( ) {
299
299
// Tests that the Gregorian calendar gives the correct expected
300
- // day, month, and year for negative years (BC/BCE/pre-gregory era)
300
+ // day, month, and year for negative years (BC/BCE era)
301
301
302
302
let cases = [
303
303
TestCase {
@@ -306,7 +306,7 @@ mod test {
306
306
iso_month : 12 ,
307
307
iso_day : 31 ,
308
308
expected_year : 1 ,
309
- expected_era : Era ( tinystr ! ( 16 , "gregory-inverse " ) ) ,
309
+ expected_era : Era ( tinystr ! ( 16 , "bce " ) ) ,
310
310
expected_month : 12 ,
311
311
expected_day : 31 ,
312
312
} ,
@@ -316,7 +316,7 @@ mod test {
316
316
iso_month : 1 ,
317
317
iso_day : 1 ,
318
318
expected_year : 1 ,
319
- expected_era : Era ( tinystr ! ( 16 , "gregory-inverse " ) ) ,
319
+ expected_era : Era ( tinystr ! ( 16 , "bce " ) ) ,
320
320
expected_month : 1 ,
321
321
expected_day : 1 ,
322
322
} ,
@@ -326,7 +326,7 @@ mod test {
326
326
iso_month : 12 ,
327
327
iso_day : 31 ,
328
328
expected_year : 2 ,
329
- expected_era : Era ( tinystr ! ( 16 , "gregory-inverse " ) ) ,
329
+ expected_era : Era ( tinystr ! ( 16 , "bce " ) ) ,
330
330
expected_month : 12 ,
331
331
expected_day : 31 ,
332
332
} ,
@@ -336,7 +336,7 @@ mod test {
336
336
iso_month : 12 ,
337
337
iso_day : 31 ,
338
338
expected_year : 5 ,
339
- expected_era : Era ( tinystr ! ( 16 , "gregory-inverse " ) ) ,
339
+ expected_era : Era ( tinystr ! ( 16 , "bce " ) ) ,
340
340
expected_month : 12 ,
341
341
expected_day : 31 ,
342
342
} ,
@@ -346,7 +346,7 @@ mod test {
346
346
iso_month : 1 ,
347
347
iso_day : 1 ,
348
348
expected_year : 5 ,
349
- expected_era : Era ( tinystr ! ( 16 , "gregory-inverse " ) ) ,
349
+ expected_era : Era ( tinystr ! ( 16 , "bce " ) ) ,
350
350
expected_month : 1 ,
351
351
expected_day : 1 ,
352
352
} ,
0 commit comments