Module:GSEvent: Difference between revisions

Created page with "-- <nowiki> local p = {} local defaults = require('Module:Paramtest').defaults local lang = mw.language.getContentLanguage() function p.main( frame ) local args = frame:ge..."
 
mNo edit summary
 
(11 intermediate revisions by the same user not shown)
Line 8: Line 8:
function p.main( frame )
function p.main( frame )
local args = frame:getParent().args
local args = frame:getParent().args
local name, edate, etime, fc, icon, details = defaults{
local name, edate, etime, dc, lc, icon, details = defaults{
{args.name, 'Unnamed'},
{args.name, 'Unnamed'},
{args.date, 'January 1 1970'},
{args.date, 'January 1 1970'},
{args.time, '00:00'},
{args.time, '00:00'},
{args.fc, 'GSW'},
{args.dc, 'GSW'},
{args.lc, 'Gem'},
{args.icon, 'G.png'},
{args.icon, 'G.png'},
{args.details, 'No Details'}
{args.details, 'No Details'}
Line 25: Line 26:
:tag('td') :wikitext( namedisp ) :done()
:tag('td') :wikitext( namedisp ) :done()
:tag('td') :wikitext( lang:formatDate('F j, G:i' , datetime) ) :done()
:tag('td') :wikitext( lang:formatDate('F j, G:i' , datetime) ) :done()
:tag('td') :wikitext( fc ) :done()
:tag('td') :wikitext( dc ) :done()
:tag('td') :wikitext( 'World '..world ) :done()
:tag('td') :wikitext( ''..lc )         :done()
:tag('td') :wikitext( details ) :done()
:tag('td') :wikitext( details ) :done()
local isotime = lang:formatDate('c', datetime)
local isotime = lang:formatDate('c', datetime)
local smwjson = '{"name":"'..name..'","time":"'..lang:formatDate('c', datetime)..'","length":'..length..',"fc":"'..fc..'","world":'..world..'}'
local smwjson = '{"name":"'..name..'","time":"'..lang:formatDate('c', datetime)..'","length":'..length..',"dc":"'..dc..'","lc":'..lc..'}'
mw.smw.set({ ['Events JSON']=smwjson })
mw.smw.set({ ['Events JSON']=smwjson })