Difference between revisions of "Module:StarlightDate"

From Starlight Wiki
Jump to navigation Jump to search
Line 12: Line 12:
 
local now_date = Date('currentdate')
 
local now_date = Date('currentdate')
 
local now_datetime = Date('currentdatetime')
 
local now_datetime = Date('currentdatetime')
return now_date:text('y')
+
return now_date.year
 
end
 
end
  

Revision as of 03:06, 15 October 2018

Documentation for this module may be created at Module:StarlightDate/doc

local p = {} -- p stands for package

function p.hello( frame )
    return "Hello, world!"
end

local Date = require('Module:Date')._Date

--local show  -- function defined below to display results

local function current_date()
	local now_date = Date('currentdate')
	local now_datetime = Date('currentdatetime')
	return now_date.year
end

local function main()
	return current_date()
end

return { main = main }