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

[досмотренная версия][досмотренная версия]
Содержимое удалено Содержимое добавлено
Нет описания правки
Нет описания правки
Строка 8:
local genitivusMonthes = {'января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'}
 
local monthg = {'января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', "сентября", "октября", "ноября", "декабря"}
 
local monthd = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
Строка 65 ⟶ 63 :
om and (
oy and {-- ДД ММММ ГГГГ ([[w:ДД ММММ]] [[w:ГГГГ]])
oj,' ',monthggenitivusMonthes[om],' ',oy,
'</span> <span style="white-space:nowrap;">([[w:',
j, ' ', monthggenitivusMonthes[m], '|', j, ' ', monthggenitivusMonthes[m], ']] ',Year0(y),')'
} or {-- ДД ММММ ([[w:ДД ММММ]]) [[w:ГГГГ]]
oj,'&nbsp;',monthggenitivusMonthes[om],' ([[w:',j,'&nbsp;',monthggenitivusMonthes[m],'|',j,'&nbsp;',monthggenitivusMonthes[m],']]) ',Year0(y)
}
) or {-- [[w:ДД ММММ|ДД (ДД) ММММ]] [[w:ГГГГ]]
'[[w:',j,' ',monthggenitivusMonthes[m],'|',oj,'&nbsp;(',j,')&nbsp;',monthggenitivusMonthes[m],']] ',Year0(y)
}
) or {'[[w:',j,'&nbsp;',monthggenitivusMonthes[m],'|',j,'&nbsp;',monthggenitivusMonthes[m],']]&nbsp;',Year0(y)}
),--/table.concat
({['Рождения']='bday',['Смерти']='dday'})[mo] or '',
Строка 83 ⟶ 81 :
oj and (
om and {-- ДД ММММ ([[w:ДД ММММ]])
oj,'&nbsp;',monthggenitivusMonthes[om],' ([[w:',j,'&nbsp;',monthggenitivusMonthes[m],'|',j,'&nbsp;',monthggenitivusMonthes[m],']])</span>'
} or {-- [[w:ДД ММММ|ДД (ДД) ММММ]]
'[[w:',j,' ',monthggenitivusMonthes[m],'|',oj,'&nbsp;(',j,')&nbsp;',monthggenitivusMonthes[m],']]</span>'
}
) or {'[[w:',j,'&nbsp;',monthggenitivusMonthes[m],'|',j,'&nbsp;',monthggenitivusMonthes[m],']]</span>'}
)
end
Строка 119 ⟶ 117 :
if not m then return nil end
m=mw.ustring.lower(m)
for i=1,12 do if m==monthggenitivusMonthes[i] then M=i;break end end--тупо перебор
if not M then return nil end
return tonumber(y),M,tonumber(d)
Строка 137 ⟶ 135 :
 
function p.monthg(f)
return monthggenitivusMonthes[ f.args[1] or f:getParent().args[1] ]
end;--realmonth
 
Строка 157 ⟶ 155 :
( (frame.args['nopersoncat'] or '')~='' or (f.args['nocat'] or '')~='' ) and '' or table.concat{
'[[К:Персоналии по алфавиту]]',
j and string.format('[[К:%s %i %s]]',catpref[mo],j,monthggenitivusMonthes[m]) or '',
y and string.format('[[К:%s в %s]]',catpref[mo],y,Year0(y,'году')) or ''
},--/table.concat внутр.