Modul:Citation: Unterschied zwischen den Versionen
range format
(moduleInterface) |
(range format) |
||
| Zeile 2: | Zeile 2: | ||
local citation = { | local citation = { | ||
suite = 'Citation', | suite = 'Citation', | ||
serial = '2021- | serial = '2021-05-19', | ||
item = 56159597 | item = 56159597 | ||
} | } | ||
| Zeile 104: | Zeile 104: | ||
elseif args.date:match( '^[12]%d%d%d$' ) then | elseif args.date:match( '^[12]%d%d%d$' ) then | ||
args.dateFormat = 'Y' | args.dateFormat = 'Y' | ||
elseif mw.ustring.match( args.date, '^[12]%d%d%d[-‒–—][12]%d%d%d$' ) or | |||
mw.ustring.match( args.date, '^[12]%d%d%d[-‒–—]$' ) then | |||
args.date = mw.ustring.gsub( args.date, '[-‒–—]', '–' ) | |||
args.dateFormat = 'R' | |||
else | else | ||
args.date = args.date:match( '%d+' ) or '' | args.date = args.date:match( '%d+' ) or '' | ||
| Zeile 239: | Zeile 243: | ||
local theDate = '' | local theDate = '' | ||
if cu.isSet( args.date ) then | if cu.isSet( args.date ) then | ||
if cu.isSet( args.dateFormat ) and args.dateFormat ~= 'Y' then | if cu.isSet( args.dateFormat ) and args.dateFormat ~= 'Y' and args.dateFormat ~= 'R' then | ||
args.dateFormat = 'M Y' | args.dateFormat = 'M Y' | ||
end | end | ||