Editing Module:D'ni Time
From Guild of Archivists
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 19: | Line 19: | ||
local msPerProrahn = msPerHahr / prorahnteePerHahr | local msPerProrahn = msPerHahr / prorahnteePerHahr | ||
local refProrahnteePerHahr = 9647 * 290 * 5 * 25 * 25 * 25 | local refProrahnteePerHahr = 9647 * 290 * 5 * 25 * 25 * 25 | ||
local vaileetee = {"Leefo","Leebro","Leesahn","Leetar","Leevot","Leevofo","Leevobro","Leevosahn","Leevotar","Leenovoo"} | |||
local vaileetee_dnifont = {"lEfo","lEbro","lEsan","lEtar","lEvot","lEvofo","lEvobro","lEvosan","lEvotar","lEnovU"} | |||
local leapSecTimeStamps = {2272060800, 2287785600, 2303683200, 2335219200, 2366755200, 2398291200, 2429913600, 2461449600, 2492985600, 2524521600, 2571782400, 2603318400, 2634854400, 2698012800, 2776982400, 2840140800, 2871676800, 2918937600, 2950473600, 2982009600, 3029443200, 3076704000, 3124137600, 3345062400, 3439756800, 3550089600, 3644697600, 3692217600} | local leapSecTimeStamps = {2272060800, 2287785600, 2303683200, 2335219200, 2366755200, 2398291200, 2429913600, 2461449600, 2492985600, 2524521600, 2571782400, 2603318400, 2634854400, 2698012800, 2776982400, 2840140800, 2871676800, 2918937600, 2950473600, 2982009600, 3029443200, 3076704000, 3124137600, 3345062400, 3439756800, 3550089600, 3644697600, 3692217600} | ||
Line 196: | Line 199: | ||
return os.date("*t",surfaceTimestamp) | return os.date("*t",surfaceTimestamp) | ||
end | |||
-- ==========Display Functions========= | |||
local function formatSurfaceTime(surfaceTime,format) | |||
format = format or 'c' | |||
lang = mw.getContentLanguage() | |||
-- return lang:formatDate(format,"@"..makeSurfaceTimeStamp(surfaceTime)) | |||
return lang:formatDate(format,tostring(surfaceTime['year'])..'-'..tostring(surfaceTime['month'])..'-'..tostring(surfaceTime['day'])..' '..tostring(surfaceTime['hour'])..':'..tostring(surfaceTime['min'])..':'..tostring(surfaceTime['sec'])) | |||
end | end | ||
Line 221: | Line 237: | ||
preprocessSingleArg('datetime') | preprocessSingleArg('datetime') | ||
preprocessSingleArg('format') | preprocessSingleArg('format') | ||
if args['datetime'] then | if args['datetime'] then | ||
surfaceTime = surfacefunc.parseSurfaceDateStr(args['datetime | surfaceTime = surfacefunc.parseSurfaceDateStr(args['datetime']) | ||
output = dnifunc.formatDniTime(surface2DniTime(makeSurfaceTimeStamp(surfaceTime)),args['format']) | output = dnifunc.formatDniTime(surface2DniTime(makeSurfaceTimeStamp(surfaceTime)),args['format']) | ||
else | else | ||
Line 235: | Line 250: | ||
-- Parse the data parameters | -- Parse the data parameters | ||
surface = {year = args['year'], month = args['month'] | surface = {year = args['year'], month = args['month'], day = args['day'], hour = args['hour'], min = args['minute'], sec = args['second']} | ||
--- output = dnifunc.displayDniTime(surface2DniTime(makeSurfaceTimeStamp(surface)),args['format']) | --- output = dnifunc.displayDniTime(surface2DniTime(makeSurfaceTimeStamp(surface)),args['format']) | ||
Line 257: | Line 272: | ||
if args['datetime'] then | if args['datetime'] then | ||
output = | output = formatSurfaceTime(dni2SurfaceTime(dnifunc.parseDniDateStr(args['datetime'],args['input'])),args['format']) | ||
else | else | ||
preprocessSingleArg('hahr') | preprocessSingleArg('hahr') | ||
Line 270: | Line 285: | ||
dni = {hahr = tonumber(args['hahr']), vailee = tonumber(args['vailee']), yahr = tonumber(args['yahr']), gahrtahvo = tonumber(args['gahrtahvo']), tahvo = tonumber(args['tahvo']), gorahn = tonumber(args['gorahn']), prorahn = tonumber(args['prorahn'])} | dni = {hahr = tonumber(args['hahr']), vailee = tonumber(args['vailee']), yahr = tonumber(args['yahr']), gahrtahvo = tonumber(args['gahrtahvo']), tahvo = tonumber(args['tahvo']), gorahn = tonumber(args['gorahn']), prorahn = tonumber(args['prorahn'])} | ||
output = surfacefunc.displaySurfaceTime(dni2SurfaceTime(dni),args['format']) | |||
output = | output = output.."<br/>"..formatSurfaceTime(dni2SurfaceTime(dni),args['format']) | ||
end | end | ||
Line 301: | Line 316: | ||
output = output .. "<br/>"..surfacefunc.displaySurfaceTime(dni2SurfaceTime(dni)) | output = output .. "<br/>"..surfacefunc.displaySurfaceTime(dni2SurfaceTime(dni)) | ||
output = output .. "<br/>"..os.date("ghdd",makeSurfaceTimeStamp(surface)) | output = output .. "<br/>"..os.date("ghdd",makeSurfaceTimeStamp(surface)) | ||
-- output = output .. "<br/>". | -- output = output .. "<br/>"..formatSurfaceTime(surface,args['format']) | ||
-- output = output .. "<br/>"..makeSurfaceTimeStamp(surface) | -- output = output .. "<br/>"..makeSurfaceTimeStamp(surface) | ||
-- output = output .. "<br/>"..lang:formatDate("c","@"..makeSurfaceTimeStamp(surface)) | -- output = output .. "<br/>"..lang:formatDate("c","@"..makeSurfaceTimeStamp(surface)) |