Module:Citation/CS1/Date validation: Difference between revisions

julian date fix;
(username removed)
m (1 revision imported)
WordPress>Trappist the monk
(julian date fix;)
Line 327: Line 327:
input.year2 = tonumber (input.year2) or lang_object:parseFormattedNumber (input.year2); -- COinS dates are pseudo-ISO 8601 so convert to Arabic numerals
input.year2 = tonumber (input.year2) or lang_object:parseFormattedNumber (input.year2); -- COinS dates are pseudo-ISO 8601 so convert to Arabic numerals


-- start temporary Julian / Gregorian calendar uncertainty detection
if ((1582 == input.year) and (10 > tonumber(input.month))) or (1582 > input.year) then -- if a Julian calendar date
local year = input.year; -- this temporary code to determine the extent of sources dated to the Julian/Gregorian
local month = tonumber(input.month); -- interstice 1 October 1582 – 1 January 1926
local day = tonumber (input.day);
if (0 ~= day) and -- day must have a value for this to be a whole date
(((1582 == year) and (10 <= month) and (12 >= month)) or -- any whole 1582 date from 1 October to 31 December or
((1926 == year) and (1 == month) and (1 == input.day)) or -- 1 January 1926 or
((1582 < year) and (1925 >= year))) then -- any date 1 January 1583 – 31 December 1925
tCOinS_date.inter_cal_cat = true; -- set category flag true
end
-- end temporary Julian / Gregorian calendar uncertainty detection
if ((1582 == year) and (10 > month)) or (1582 > year) then -- if a Julian calendar date
tCOinS_date.rftdate = tostring (input.year); -- &rft.date gets year only
tCOinS_date.rftdate = tostring (input.year); -- &rft.date gets year only
return; -- done
return; -- done