Module:DateI18n: Difference between revisions

Content deleted Content added
m correction to the last edit
m Protected "Module:DateI18n" ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
 
(6 intermediate revisions by 3 users not shown)
Line 15:
* User:Jarekt - original version of the functions mimicking template:Date
]]
require('Module:No globalsstrict')
 
-- ==================================================
Line 72:
-- if month is not a number than check if it is a month name in project's language
local month = datevec[2]
if month and month~='' and not tonumber(month) then
datevec[2] = mw.getContentLanguage():formatDate( "n", month)
end
Line 78:
-- create datecode based on which variables are provided and check for out-of-bound values
local maxval = {nil, 12, 31, 23, 59, 59, 23, 59} -- max values for year, month, ...
local minval = {nil, 1, 01, 0, 0, 0, -23, 0} -- min values for year, month, ...
local c = {'Y', 'M', 'D', 'H', 'M', 'S', '', ''}
local datecode = '' -- a string signifying which combination of variables was provided