更改

添加210字节 、 2023年4月12日 (三) 12:17
导入1个版本
第928行: 第928行:  
end
 
end
   −
 
+
local function tidy_date(date)
 +
if date:match("^%d%d%d%d%-%d%d?%-%d%d?$") then
 +
local y, m, d = date:match("(%d%d%d%d)%-(%d%d?)%-(%d%d?)")
 +
return y..'-'..string.format('%02d', m)..'-'..string.format('%02d', d)
 +
else
 +
return date
 +
end
 +
end
 
--[[--------------------------< N O W R A P _ D A T E >--------------------------------------------------------
 
--[[--------------------------< N O W R A P _ D A T E >--------------------------------------------------------
   第1,370行: 第1,377行:     
local function pmc(id, embargo)
 
local function pmc(id, embargo)
local test_limit = 7500000; -- update this value as PMCs approach
+
local test_limit = 7000000; -- update this value as PMCs approach
 
local handler = cfg.id_handlers['PMC'];
 
local handler = cfg.id_handlers['PMC'];
 
local err_cat = ''; -- presume that PMC is valid
 
local err_cat = ''; -- presume that PMC is valid
第2,835行: 第2,842行:  
local PublicationDate = A['PublicationDate'];
 
local PublicationDate = A['PublicationDate'];
 
local OrigYear = A['OrigYear'];
 
local OrigYear = A['OrigYear'];
local Date = A['Date'];
+
local Date = tidy_date( A['Date'] );
local LayDate = A['LayDate'];
+
local LayDate = tidy_date( A['LayDate'] );
 
------------------------------------------------- Get title data
 
------------------------------------------------- Get title data
 
local Title = A['Title'];
 
local Title = A['Title'];
第2,904行: 第2,911行:     
local Via = A['Via'];
 
local Via = A['Via'];
local AccessDate = A['AccessDate'];
+
local AccessDate = tidy_date( A['AccessDate'] );
local ArchiveDate = A['ArchiveDate'];
+
local ArchiveDate = tidy_date( A['ArchiveDate'] );
 
local Agency = A['Agency'];
 
local Agency = A['Agency'];
 
local DeadURL = A['DeadURL']
 
local DeadURL = A['DeadURL']
第4,008行: 第4,015行:  
 
 
if is_set(options.id) then 
 
if is_set(options.id) then 
text = '<cite id="' .. mw.uri.anchorEncode(options.id) ..'" class="' .. mw.text.nowiki(options.class) .. '">' .. text .. "</cite>";
+
text = '<cite id="' .. mw.uri.anchorEncode(options.id) ..'" class="' .. mw.text.nowiki(options.class) .. '" style="font-style:inherit">' .. text .. "</cite>";
 
else
 
else
text = '<cite class="' .. mw.text.nowiki(options.class) .. '">' .. text .. "</cite>";
+
text = '<cite class="' .. mw.text.nowiki(options.class) .. '" style="font-style:inherit">' .. text .. "</cite>";
end
+
end 
    
local empty_span = '<span style="display:none;">&nbsp;</span>';
 
local empty_span = '<span style="display:none;">&nbsp;</span>';
第4,046行: 第4,053行:  
end
 
end
 
for _, v in ipairs( z.maintenance_cats ) do -- append maintenance categories
 
for _, v in ipairs( z.maintenance_cats ) do -- append maintenance categories
text = text .. '[[Category:' .. v ..']]';
  −
end
  −
for _, v in ipairs( z.properties_cats ) do -- append maintenance categories
   
text = text .. '[[Category:' .. v ..']]';
 
text = text .. '[[Category:' .. v ..']]';
 
end
 
end