From ee935784ccdf6e75a853f80b78dac6bf7fb95fbe Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Wed, 4 Jan 2023 11:44:51 +1100 Subject: Remove server-side conversion of YearDates >4713 BC to CalDates The conversion was originally intended to simply the code. But, as events may span years before and after 4713 BC, the conversion introduces the possibility of having both YearDates and CalDates in the same event, which is unhelpful. --- backend/hist_data/cal.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'backend/hist_data') diff --git a/backend/hist_data/cal.py b/backend/hist_data/cal.py index 550303e..29959ef 100644 --- a/backend/hist_data/cal.py +++ b/backend/hist_data/cal.py @@ -94,10 +94,7 @@ class HistDate: def dbDateToHistDate(n: int, fmt: int, end=False) -> HistDate: """ Converts a start/start_upper/etc and fmt value in the 'events' db table, into a HistDate """ if fmt == 0: # year - if n >= MIN_CAL_YEAR: - return HistDate(True, n, 1, 1) - else: - return HistDate(None, n) + return HistDate(None, n) elif fmt == 1 or fmt == 3 and end: # jdn for gregorian calendar return HistDate(True, *jdnToGregorian(n)) else: # fmt == 2 or fmt == 3 and not end -- cgit v1.2.3