Difference between revisions of "Module:StarlightDate"
Jump to navigation
Jump to search
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
local p = {} -- p stands for package | local p = {} -- p stands for package | ||
− | + | -- | |
function p.hello( frame ) | function p.hello( frame ) | ||
return "Hello, world!" | return "Hello, world!" | ||
Line 7: | Line 7: | ||
local Date = require('Module:Date')._Date | local Date = require('Module:Date')._Date | ||
− | local show -- function defined below to display results | + | --local show -- function defined below to display results |
local function current_date() | local function current_date() | ||
local now_date = Date('currentdate') | local now_date = Date('currentdate') | ||
local now_datetime = Date('currentdatetime') | local now_datetime = Date('currentdatetime') | ||
− | + | return now_date.year | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
end | end | ||
local function main() | local function main() | ||
− | current_date() | + | return current_date() |
end | end | ||
return { main = main } | return { main = main } |
Latest revision as of 10:18, 27 November 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 }