Content deleted Content added
one check, not two |
No edit summary |
||
Line 2:
History of changes since last sync: 2020-10-10
2021-02-13: i18n support for year/date mismatch; see Help_talk:Citation_Style_1#Year%2Fdate_mismatch_error_config_to_be_moved_to_config_module
2021-03-31: support edtf uncertain date format; see Help_talk:Citation_Style_1#edtf_date_formats_as_cs1|2_date_parameter_values_(2)
]]
Line 306 ⟶ 307:
range_end_number = get_month_number (range_end); -- get end month number
if range_start_number < range_end_number and -- range_start is a month; does range_start precede range_end?
return true;
end
return false; -- range_start month number is greater than or equal to range end number; or range end isn't a month
Line 1,056 ⟶ 1,057:
for param_name, param_val in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set (param_val.val) and
not mw.ustring.match (param_val.val,
param_val.val, n = param_val.val:gsub ('%-', '–'); -- replace any hyphen with ndash
if 0 ~= n then
date_parameters_list[param_name].val = param_val.val; -- update the list
result = true;
end
end
end
Line 1,073 ⟶ 1,074:
Only YYY-MM-XX supported at this time. Not called if the cs1|2 template has any date errors.
must be done before reformat_dates() and before date_hyphen_to_dash()
Modifies the date_parameters_list and returns true if transformation is performed, else returns false.
|