use crate::calendar::gregorian::Gregorian;
use crate::calendar::prelude::CommonDate;
use crate::calendar::prelude::HasLeapYears;
use crate::calendar::prelude::OrdinalDate;
use crate::calendar::prelude::Perennial;
use crate::calendar::prelude::Quarter;
use crate::calendar::prelude::ToFromCommonDate;
use crate::calendar::prelude::ToFromOrdinalDate;
use crate::calendar::CalendarMoment;
use crate::calendar::HasEpagemonae;
use crate::clock::ClockTime;
use crate::clock::TimeOfDay;
use crate::common::error::CalendarError;
use crate::common::math::TermNum;
use crate::day_count::BoundedDayCount;
use crate::day_count::CalculatedBounds;
use crate::day_count::Epoch;
use crate::day_count::Fixed;
use crate::day_count::FromFixed;
use crate::day_count::ToFixed;
use crate::day_cycle::Weekday;
#[allow(unused_imports)] use num_traits::FromPrimitive;
use std::cmp::Ordering;
use std::num::NonZero;
const TRANQUILITY_EPOCH_GREGORIAN: CommonDate = CommonDate {
year: 1969,
month: 7,
day: 20,
};
const NON_MONTH: u8 = 0;
const TRANQUILITY_EPOCH_CLOCK: ClockTime = ClockTime {
hours: 20,
minutes: 18,
seconds: 1.2,
};
#[derive(Debug, PartialEq, PartialOrd, Clone, Copy, FromPrimitive, ToPrimitive)]
pub enum TranquilityMonth {
Archimedes = 1,
Brahe,
Copernicus,
Darwin,
Einstein,
Faraday,
Galileo,
Hippocrates,
Imhotep,
Jung,
Kepler,
Lavoisier,
Mendel,
}
const AFTER_H27: i64 = (TranquilityMonth::Hippocrates as i64) * 28;
#[derive(Debug, PartialEq, PartialOrd, Clone, Copy, FromPrimitive, ToPrimitive)]
pub enum TranquilityComplementaryDay {
MoonLandingDay = 0,
ArmstrongDay,
AldrinDay,
}
#[derive(Debug, PartialEq, Clone, Copy)]
pub struct Tranquility(CommonDate);
impl Tranquility {
pub fn prior_elapsed_days(year: i32) -> i64 {
if year == 0 {
TranquilityMoment::epoch().get_day_i() - 1
} else {
let y = if year < 0 { year + 1 } else { year };
let prior_g = Gregorian::try_from_common_date(CommonDate {
year: (y - 1) + TRANQUILITY_EPOCH_GREGORIAN.year,
month: TRANQUILITY_EPOCH_GREGORIAN.month,
day: TRANQUILITY_EPOCH_GREGORIAN.day,
})
.expect("Month and day known to be valid.");
prior_g.to_fixed().get_day_i()
}
}
}
impl ToFromOrdinalDate for Tranquility {
fn valid_ordinal(ord: OrdinalDate) -> Result<(), CalendarError> {
let correction = if TranquilityMoment::is_leap(ord.year) {
1
} else {
0
};
if ord.day_of_year > 0 && ord.day_of_year <= (365 + correction) {
Ok(())
} else {
Err(CalendarError::InvalidDayOfYear)
}
}
fn ordinal_from_fixed(fixed_date: Fixed) -> OrdinalDate {
const ORDINAL_SHIFT: i64 = ((TranquilityMonth::Faraday as i64) * 28) - 4;
let g_ord = Gregorian::ordinal_from_fixed(fixed_date);
let g_doy_shift = (g_ord.day_of_year as i64) + ORDINAL_SHIFT;
let g_len = if Gregorian::is_leap(g_ord.year) {
366
} else {
365
};
let tq_doy = g_doy_shift.adjusted_remainder(g_len);
let y_approx_0 = g_ord.year - TRANQUILITY_EPOCH_GREGORIAN.year;
let correct_0 = if tq_doy <= ORDINAL_SHIFT { 1 } else { 0 };
let y_approx_1 = y_approx_0 + correct_0;
let year = if y_approx_1 < 1 {
y_approx_1 - 1
} else {
y_approx_1
};
if year == -1 && tq_doy == 365 {
OrdinalDate {
year: 0,
day_of_year: 1,
}
} else {
OrdinalDate {
year: year,
day_of_year: tq_doy as u16,
}
}
}
fn to_ordinal(self) -> OrdinalDate {
let comp_count = Self::epagomenae_count(self.0.year) as i64;
let ordinal_day = match self.epagomenae() {
Some(TranquilityComplementaryDay::MoonLandingDay) => 1,
Some(TranquilityComplementaryDay::ArmstrongDay) => 364 + comp_count,
Some(TranquilityComplementaryDay::AldrinDay) => AFTER_H27,
None => {
let month = self.0.month as i64;
let day = self.0.day as i64;
let approx = ((month - 1) * 28) + day;
let correction = if approx < AFTER_H27 || comp_count < 2 {
0
} else {
1
};
approx + correction
}
};
OrdinalDate {
year: self.0.year,
day_of_year: ordinal_day as u16,
}
}
fn from_ordinal_unchecked(ord: OrdinalDate) -> Self {
let date_tq = match (
ord.day_of_year as i64,
ord.year,
TranquilityMoment::is_leap(ord.year),
) {
(_, 0, _) => CommonDate::new(0, NON_MONTH, 0),
(365, _, false) => CommonDate::new(ord.year, NON_MONTH, 1),
(366, _, true) => CommonDate::new(ord.year, NON_MONTH, 1),
(AFTER_H27, _, true) => CommonDate::new(ord.year, NON_MONTH, 2),
(doy, y, is_leap) => {
let correction = if doy < AFTER_H27 || !is_leap { 0 } else { 1 };
let month = ((((doy - correction) - 1) as i64).div_euclid(28) + 1) as u8;
let day = ((doy - correction) as i64).adjusted_remainder(28) as u8;
debug_assert!(month > 0 && month < 14, "doy: {}, y: {}", doy, y);
CommonDate::new(y, month, day)
}
};
Tranquility(date_tq)
}
}
impl PartialOrd for Tranquility {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
if self == other {
Some(Ordering::Equal)
} else {
let self_ord = self.to_ordinal();
let other_ord = other.to_ordinal();
self_ord.partial_cmp(&other_ord)
}
}
}
impl HasEpagemonae<TranquilityComplementaryDay> for Tranquility {
fn epagomenae(self) -> Option<TranquilityComplementaryDay> {
if self.0.month == NON_MONTH {
TranquilityComplementaryDay::from_u8(self.0.day)
} else {
None
}
}
fn epagomenae_count(p_year: i32) -> u8 {
if Self::is_leap(p_year) {
2
} else if p_year == -1 {
0
} else {
1
}
}
}
impl Perennial<TranquilityMonth, Weekday> for Tranquility {
fn weekday(self) -> Option<Weekday> {
if self.epagomenae().is_some() {
None
} else {
Weekday::from_i64(((self.0.day as i64) + 4).modulus(7))
}
}
fn days_per_week() -> u8 {
7
}
fn weeks_per_month() -> u8 {
4
}
}
impl HasLeapYears for Tranquility {
fn is_leap(t_year: i32) -> bool {
if t_year > 0 {
Gregorian::is_leap(t_year + TRANQUILITY_EPOCH_GREGORIAN.year)
} else if t_year < 0 {
Gregorian::is_leap(t_year + TRANQUILITY_EPOCH_GREGORIAN.year + 1)
} else {
false
}
}
}
impl CalculatedBounds for Tranquility {}
impl Epoch for Tranquility {
fn epoch() -> Fixed {
let date = Gregorian::try_from_common_date(TRANQUILITY_EPOCH_GREGORIAN)
.expect("Epoch known to be valid")
.to_fixed();
let time = TimeOfDay::try_from_clock(TRANQUILITY_EPOCH_CLOCK).expect("Known valid");
Fixed::new(date.get() + time.get())
}
}
impl FromFixed for Tranquility {
fn from_fixed(date: Fixed) -> Tranquility {
let ord = Tranquility::ordinal_from_fixed(date);
Tranquility::from_ordinal_unchecked(ord)
}
}
impl ToFixed for Tranquility {
fn to_fixed(self) -> Fixed {
let ord = self.to_ordinal();
let offset_prior = Tranquility::prior_elapsed_days(ord.year);
Fixed::new((offset_prior as f64) + (ord.day_of_year as f64))
}
}
impl ToFromCommonDate<TranquilityMonth> for Tranquility {
fn to_common_date(self) -> CommonDate {
self.0
}
fn from_common_date_unchecked(date: CommonDate) -> Self {
debug_assert!(Self::valid_ymd(date).is_ok());
Self(date)
}
fn valid_ymd(date: CommonDate) -> Result<(), CalendarError> {
if date.month > 13 {
Err(CalendarError::InvalidMonth)
} else if date.month == NON_MONTH {
if date.day == 0 && date.year == 0 {
Ok(())
} else if date.day == 1 && date.year != 0 && date.year != -1 {
Ok(())
} else if date.day == 2 && date.year != 0 && Self::is_leap(date.year) {
Ok(())
} else {
Err(CalendarError::InvalidDay)
}
} else if date.day < 1 || date.day > 28 {
Err(CalendarError::InvalidDay)
} else if date.year == 0 {
Err(CalendarError::InvalidYear)
} else {
Ok(())
}
}
fn year_start_date(year: i32) -> CommonDate {
if year == 0 {
CommonDate::new(
year,
NON_MONTH,
TranquilityComplementaryDay::MoonLandingDay as u8,
)
} else {
CommonDate::new(year, 1, 1)
}
}
fn year_end_date(year: i32) -> CommonDate {
if year == 0 {
CommonDate::new(
year,
NON_MONTH,
TranquilityComplementaryDay::MoonLandingDay as u8,
)
} else if year == -1 {
CommonDate::new(year, TranquilityMonth::Mendel as u8, 28)
} else {
CommonDate::new(
year,
NON_MONTH,
TranquilityComplementaryDay::ArmstrongDay as u8,
)
}
}
fn month_length(_year: i32, _month: TranquilityMonth) -> u8 {
28
}
}
impl Quarter for Tranquility {
fn quarter(self) -> NonZero<u8> {
match (self.try_week_of_year(), self.epagomenae()) {
(None, Some(TranquilityComplementaryDay::MoonLandingDay)) => NonZero::new(4).unwrap(),
(None, Some(TranquilityComplementaryDay::ArmstrongDay)) => NonZero::new(4).unwrap(),
(None, Some(TranquilityComplementaryDay::AldrinDay)) => NonZero::new(3).unwrap(),
(Some(w), None) => NonZero::new((w - 1) / 13 + 1).expect("w > 0"),
(_, _) => unreachable!(),
}
}
}
pub type TranquilityMoment = CalendarMoment<Tranquility>;
impl TranquilityMoment {
pub fn is_after_tranquility(self) -> bool {
if self.date().0.year == 0 {
self.time_of_day() > TRANQUILITY_EPOCH_CLOCK
} else {
self.date().0.year > 0
}
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::day_count::RataDie;
use crate::day_count::FIXED_MAX;
use crate::day_count::FIXED_MIN;
use proptest::proptest;
#[test]
fn moon_landing_edge_cases() {
let f0 = TranquilityMoment::epoch();
let q0 = TranquilityMoment::from_fixed(f0);
let c = CommonDate::new(0, 0, 0);
assert_eq!(q0.to_common_date(), c);
let f1 = q0.to_fixed();
assert_eq!(f0, f1);
assert_eq!(c, TranquilityMoment::year_end_date(0));
assert_eq!(c, TranquilityMoment::year_start_date(0));
}
#[test]
fn one_bt_edge_cases() {
let c = CommonDate::new(-1, 13, 28);
assert_eq!(c, TranquilityMoment::year_end_date(-1));
}
#[test]
fn obvious_conversions_from_gregorian() {
let d_list = [
(CommonDate::new(1969, 7, 20), CommonDate::new(0, 0, 0)),
(CommonDate::new(1969, 6, 30), CommonDate::new(-1, 13, 9)),
(CommonDate::new(1969, 7, 1), CommonDate::new(-1, 13, 10)),
(CommonDate::new(1969, 7, 9), CommonDate::new(-1, 13, 18)),
(CommonDate::new(1969, 7, 19), CommonDate::new(-1, 13, 28)),
(CommonDate::new(1969, 7, 21), CommonDate::new(1, 1, 1)),
(CommonDate::new(1969, 7, 31), CommonDate::new(1, 1, 11)),
(CommonDate::new(1969, 8, 1), CommonDate::new(1, 1, 12)),
(CommonDate::new(1965, 7, 20), CommonDate::new(-5, 0, 1)),
(CommonDate::new(1968, 7, 20), CommonDate::new(-2, 0, 1)),
(CommonDate::new(1970, 7, 20), CommonDate::new(1, 0, 1)),
(CommonDate::new(1989, 7, 20), CommonDate::new(20, 0, 1)), (CommonDate::new(1995, 7, 20), CommonDate::new(26, 0, 1)),
(CommonDate::new(1995, 7, 21), CommonDate::new(27, 1, 1)),
(CommonDate::new(2000, 7, 20), CommonDate::new(31, 0, 1)),
(CommonDate::new(2020, 7, 20), CommonDate::new(51, 0, 1)),
(CommonDate::new(2025, 7, 20), CommonDate::new(56, 0, 1)),
(CommonDate::new(1968, 2, 29), CommonDate::new(-2, 0, 2)),
(CommonDate::new(1972, 2, 29), CommonDate::new(3, 0, 2)),
(CommonDate::new(2000, 2, 29), CommonDate::new(31, 0, 2)),
];
for pair in d_list {
let dg = Gregorian::try_from_common_date(pair.0).unwrap().to_fixed();
let dq = TranquilityMoment::try_from_common_date(pair.1)
.unwrap()
.to_fixed();
assert_eq!(dq.get_day_i(), dg.get_day_i());
}
}
#[test]
fn article_examples() {
let d_list = [
(CommonDate::new(1978, 7, 25), CommonDate::new(10, 1, 5)),
(CommonDate::new(1958, 7, 29), CommonDate::new(-11, 1, 9)),
(CommonDate::new(1953, 8, 12), CommonDate::new(-16, 1, 23)),
(CommonDate::new(1989, 8, 17), CommonDate::new(21, 1, 28)),
(CommonDate::new(1977, 8, 20), CommonDate::new(9, 2, 3)),
(CommonDate::new(79, 8, 24), CommonDate::new(-1890, 2, 7)),
(CommonDate::new(1989, 8, 31), CommonDate::new(21, 2, 14)),
(CommonDate::new(1976, 9, 3), CommonDate::new(8, 2, 17)),
(CommonDate::new(1857, 9, 5), CommonDate::new(-112, 2, 19)),
(CommonDate::new(1982, 9, 9), CommonDate::new(14, 2, 23)),
(CommonDate::new(1989, 9, 23), CommonDate::new(21, 3, 9)),
(CommonDate::new(1988, 9, 29), CommonDate::new(20, 3, 15)),
(CommonDate::new(1957, 10, 4), CommonDate::new(-12, 3, 20)),
(CommonDate::new(1492, 10, 12), CommonDate::new(-477, 3, 28)), (CommonDate::new(1947, 10, 14), CommonDate::new(-22, 4, 2)),
(CommonDate::new(1797, 10, 22), CommonDate::new(-172, 4, 10)),
(CommonDate::new(1957, 11, 3), CommonDate::new(-12, 4, 22)),
(CommonDate::new(1922, 11, 4), CommonDate::new(-47, 4, 23)),
(CommonDate::new(1951, 11, 10), CommonDate::new(-18, 5, 1)),
(CommonDate::new(1980, 11, 12), CommonDate::new(12, 5, 3)),
(CommonDate::new(1859, 11, 24), CommonDate::new(-110, 5, 15)),
(CommonDate::new(1903, 12, 17), CommonDate::new(-66, 6, 10)),
(CommonDate::new(1989, 12, 21), CommonDate::new(21, 6, 14)),
(CommonDate::new(1990, 1, 1), CommonDate::new(21, 6, 25)),
(CommonDate::new(1610, 1, 7), CommonDate::new(-360, 7, 3)),
(CommonDate::new(1812, 1, 23), CommonDate::new(-158, 7, 19)),
(CommonDate::new(1990, 1, 26), CommonDate::new(21, 7, 22)),
(CommonDate::new(1967, 1, 27), CommonDate::new(-3, 7, 23)),
(CommonDate::new(1986, 1, 28), CommonDate::new(17, 7, 24)),
(CommonDate::new(1966, 2, 3), CommonDate::new(-4, 8, 2)),
(CommonDate::new(1984, 2, 3), CommonDate::new(15, 8, 2)),
(CommonDate::new(1600, 2, 17), CommonDate::new(-370, 8, 16)),
(CommonDate::new(1930, 2, 18), CommonDate::new(-40, 8, 17)),
(CommonDate::new(1962, 2, 20), CommonDate::new(-8, 8, 19)),
(CommonDate::new(1932, 2, 27), CommonDate::new(-38, 8, 26)),
(CommonDate::new(1990, 3, 20), CommonDate::new(21, 9, 19)),
(CommonDate::new(1979, 3, 28), CommonDate::new(10, 9, 27)),
(CommonDate::new(1974, 3, 29), CommonDate::new(5, 9, 28)),
(CommonDate::new(1826, 4, 1), CommonDate::new(-144, 10, 3)),
(CommonDate::new(1909, 4, 6), CommonDate::new(-61, 10, 8)),
(CommonDate::new(1961, 4, 12), CommonDate::new(-9, 10, 14)),
(CommonDate::new(1972, 4, 16), CommonDate::new(3, 10, 18)),
(CommonDate::new(1953, 04, 25), CommonDate::new(-17, 10, 27)),
(CommonDate::new(1961, 05, 05), CommonDate::new(-9, 11, 9)),
(CommonDate::new(1927, 05, 21), CommonDate::new(-43, 11, 25)),
(CommonDate::new(1976, 05, 24), CommonDate::new(7, 11, 28)),
(CommonDate::new(-584, 5, 28), CommonDate::new(-2554, 12, 4)),
(CommonDate::new(1971, 5, 30), CommonDate::new(2, 12, 6)),
(CommonDate::new(1896, 6, 2), CommonDate::new(-74, 12, 9)),
(CommonDate::new(1979, 6, 12), CommonDate::new(10, 12, 19)),
(CommonDate::new(1983, 6, 13), CommonDate::new(14, 12, 20)),
(CommonDate::new(1752, 6, 15), CommonDate::new(-218, 12, 22)),
(CommonDate::new(1983, 6, 18), CommonDate::new(14, 12, 25)),
(CommonDate::new(1990, 6, 21), CommonDate::new(21, 12, 28)),
(CommonDate::new(1947, 6, 24), CommonDate::new(-23, 13, 3)),
(CommonDate::new(1908, 6, 30), CommonDate::new(-62, 13, 9)),
(CommonDate::new(1979, 7, 11), CommonDate::new(10, 13, 20)),
(CommonDate::new(1945, 7, 16), CommonDate::new(-25, 13, 25)),
];
for pair in d_list {
let dg = Gregorian::try_from_common_date(pair.0).unwrap().to_fixed();
let dq = TranquilityMoment::try_from_common_date(pair.1)
.unwrap()
.to_fixed();
assert_eq!(dg.get_day_i(), dq.get_day_i(), "{:?}", pair);
}
}
#[test]
fn orions_arm() {
let d_list = [
(CommonDate::new(1910, 10, 19), -59), (CommonDate::new(1995, 8, 21), 27), (CommonDate::new(1879, 3, 14), -91), (CommonDate::new(1955, 4, 18), -15), (CommonDate::new(1934, 3, 9), -36), (CommonDate::new(1968, 3, 27), -2), (CommonDate::new(1912, 6, 23), -58), (CommonDate::new(1954, 6, 7), -16), ];
for pair in d_list {
let f = Gregorian::try_from_common_date(pair.0).unwrap().to_fixed();
let dq = TranquilityMoment::from_fixed(f);
assert_eq!(dq.year(), pair.1);
}
}
proptest! {
#[test]
fn gregorian_lookup(t in FIXED_MIN..FIXED_MAX) {
let f = RataDie::new(t).to_fixed().to_day();
let g = Gregorian::from_fixed(f);
let gc = g.to_common_date();
let q = TranquilityMoment::from_fixed(f);
if q.try_month().is_some() {
let qm = q.try_month().unwrap();
let entry = match qm {
TranquilityMonth::Archimedes => ((7, 21), (8, 17)),
TranquilityMonth::Brahe => ((8, 18), (9, 14)),
TranquilityMonth::Copernicus => ((9, 15), (10, 12)),
TranquilityMonth::Darwin => ((10, 13), (11, 9)),
TranquilityMonth::Einstein => ((11, 10), (12, 7)),
TranquilityMonth::Faraday => ((12, 8), (1, 4)),
TranquilityMonth::Galileo => ((1, 5), (2, 1)),
TranquilityMonth::Hippocrates => ((2, 2), (3, 1)),
TranquilityMonth::Imhotep => ((3, 2), (3, 29)),
TranquilityMonth::Jung => ((3, 30), (4, 26)),
TranquilityMonth::Kepler => ((4, 27), (5, 24)),
TranquilityMonth::Lavoisier => ((5, 25), (6, 21)),
TranquilityMonth::Mendel => ((6, 22), (7, 19)),
};
let mut y_min = gc.year;
let mut y_max = gc.year;
if qm == TranquilityMonth::Faraday {
let in_new_year = gc.month == entry.1.0;
y_min = if in_new_year { gc.year - 1 } else { gc.year };
y_max = y_min + 1;
}
let gc_min = CommonDate::new(y_min, entry.0.0, entry.0.1);
let gc_max = CommonDate::new(y_max, entry.1.0, entry.1.1);
assert!(gc >= gc_min, "gc: {:?}, gc_min: {:?}, q: {:?}", gc, gc_min, q);
assert!(gc <= gc_max, "gc: {:?}, gc_max: {:?}, q: {:?}", gc, gc_max, q);
} else {
let qc = q.epagomenae().unwrap();
let entry = match qc {
TranquilityComplementaryDay::MoonLandingDay => (7, 20),
TranquilityComplementaryDay::ArmstrongDay => (7, 20),
TranquilityComplementaryDay::AldrinDay => (2, 29)
};
assert_eq!(gc.month as i64, entry.0);
assert_eq!(gc.day as i64, entry.1);
}
}
#[test]
fn gregorian_lookup_small(t in i8::MIN..i8::MAX) {
let e = TranquilityMoment::epoch().get_day_i();
let f = RataDie::cast_new(e + (t as i64)).to_fixed().to_day();
let g = Gregorian::from_fixed(f);
let gc = g.to_common_date();
let q = TranquilityMoment::from_fixed(f);
if q.try_month().is_some() {
let qm = q.try_month().unwrap();
let entry = match qm {
TranquilityMonth::Archimedes => ((7, 21), (8, 17)),
TranquilityMonth::Brahe => ((8, 18), (9, 14)),
TranquilityMonth::Copernicus => ((9, 15), (10, 12)),
TranquilityMonth::Darwin => ((10, 13), (11, 9)),
TranquilityMonth::Einstein => ((11, 10), (12, 7)),
TranquilityMonth::Faraday => ((12, 8), (1, 4)),
TranquilityMonth::Galileo => ((1, 5), (2, 1)),
TranquilityMonth::Hippocrates => ((2, 2), (3, 1)),
TranquilityMonth::Imhotep => ((3, 2), (3, 29)),
TranquilityMonth::Jung => ((3, 30), (4, 26)),
TranquilityMonth::Kepler => ((4, 27), (5, 24)),
TranquilityMonth::Lavoisier => ((5, 25), (6, 21)),
TranquilityMonth::Mendel => ((6, 22), (7, 19)),
};
let mut y_min = gc.year;
let mut y_max = gc.year;
if qm == TranquilityMonth::Faraday {
let in_new_year = gc.month == entry.1.0;
y_min = if in_new_year { gc.year - 1 } else { gc.year };
y_max = y_min + 1;
}
let gc_min = CommonDate::new(y_min, entry.0.0, entry.0.1);
let gc_max = CommonDate::new(y_max, entry.1.0, entry.1.1);
assert!(gc >= gc_min, "gc: {:?}, gc_min: {:?}, q: {:?}", gc, gc_min, q);
assert!(gc <= gc_max, "gc: {:?}, gc_max: {:?}, q: {:?}", gc, gc_max, q);
} else {
let qc = q.epagomenae().unwrap();
let entry = match qc {
TranquilityComplementaryDay::MoonLandingDay => (7, 20),
TranquilityComplementaryDay::ArmstrongDay => (7, 20),
TranquilityComplementaryDay::AldrinDay => (2, 29)
};
assert_eq!(gc.month as i64, entry.0);
assert_eq!(gc.day as i64, entry.1);
}
}
}
}