Модуль:Dates: различия между версиями

[досмотренная версия][досмотренная версия]
Содержимое удалено Содержимое добавлено
Текущая версия w:Модуль:Dates
 
м Ссылки на Википедию
Строка 40:
local function Year0(y,t)-- аналог Год0
if y>0 then return table.concat{
'[[w:', tostring(y), ' год|', t and tostring(y)..' '..t or tostring(y), ']]'
} else return table.concat{
'[[w:', tostring(-y), ' год до н. э.|',
t and tostring(-y)..' '..t or tostring(-y),
' до н. э.]]'
Строка 58:
oj and (
om and (
oy and {-- ДД ММММ ГГГГ ([[w:ДД ММММ]] [[w:ГГГГ]])
oj,' ',monthg[om],' ',oy,
'</span> <span style="white-space:nowrap;">([[w:',
j, ' ', monthg[m],']] ',Year0(y),')'
} or {-- ДД ММММ ([[w:ДД ММММ]]) [[w:ГГГГ]]
oj,'&nbsp;',monthg[om],' ([[w:',j,'&nbsp;',monthg[m],']]) ',Year0(y)
}
) or {-- [[w:ДД ММММ|ДД (ДД) ММММ]] [[w:ГГГГ]]
'[[w:',j,' ',monthg[m],'|',oj,'&nbsp;(',j,')&nbsp;',monthg[m],']] ',Year0(y)
}
) or {'[[w:',j,'&nbsp;',monthg[m],']]&nbsp;',Year0(y)}
),--/table.concat
({['Рождения']='bday',['Смерти']='dday'})[mo] or '',
Строка 76:
'<span style="white-space:nowrap;">' .. table.concat(
oj and (
om and {-- ДД ММММ ([[w:ДД ММММ]])
oj,'&nbsp;',monthg[om],' ([[w:',j,'&nbsp;',monthg[m],']])</span>'
} or {-- [[w:ДД ММММ|ДД (ДД) ММММ]]
'[[w:',j,' ',monthg[m],'|',oj,'&nbsp;(',j,')&nbsp;',monthg[m],']]</span>'
}
) or {'[[w:',j,'&nbsp;',monthg[m],']]</span>'}
)
end
Строка 369:
function nominativeYear( year )
if ( year >= 0 ) then
return '[[w:' .. year .. ' год|' .. year .. ']]'
else
return '[[w:' .. ( 0 - year ) .. ' год до н. э.|' .. ( 0 - year ) .. ' до н. э.]]'
end
end
Строка 397:
local datePart = '<span style="white-space:nowrap;">'
if (template == "12") then
datePart = datePart .. string.format( "[[w:%d %s]]",
nd, genitivusMonthes[nm] )
elseif (template == "23") then
datePart = datePart .. string.format( "[[w:%s]] %s",
nominativeMonthes[nm], nominativeYear( ny ) )
elseif (template == "3") then
datePart = datePart .. nominativeYear( ny )
elseif (template == "123") then
datePart = datePart .. string.format( "[[w:%d %s]] %s",
nd, genitivusMonthes[nm], nominativeYear( ny ) )
elseif (template == "124") then
datePart = datePart .. string.format( "[[w:%d %s|%d (%d) %s]]",
nd, genitivusMonthes[nm], od, nd, genitivusMonthes[nm] )
elseif (template == "1234") then
datePart = datePart .. string.format( "[[w:%d %s|%d (%d) %s]] %s",
nd, genitivusMonthes[nm], od, nd, genitivusMonthes[nm], nominativeYear( ny ) )
elseif (template == "1245") then
datePart = datePart .. string.format( "%d %s ([[w:%d %s]])",
od, genitivusMonthes[om], nd, genitivusMonthes[nm] )
elseif (template == "12345") then
datePart = datePart .. string.format( "%d %s ([[w:%d %s]]) %s",
od, genitivusMonthes[om], nd, genitivusMonthes[nm], nominativeYear( ny ) )
elseif (template == "123456") then
datePart = datePart .. string.format( '%d %s %d</span> <span style="white-space:nowrap;">([[w:%d %s]] %s)',
od, genitivusMonthes[om], oy, nd, genitivusMonthes[nm], nominativeYear( ny ) )
else