Module:DafYomi
Appearance
![]() | This module is rated as ready for general use. It has reached a mature form and is thought to be relatively bug-free and ready for use wherever appropriate. It is ready to mention on help pages and other Wikipedia resources as an option for new users to learn. To reduce server load and bad output, it should be improved by sandbox testing rather than repeated trial-and-error editing. |
Usage
{{#invoke:DafYomi|today}}
{{#invoke:DafYomi|date|month=7|day=31|year=2020}}
{{#invoke:DafYomi|today|format=''daf'' %d of Tractate ''%m''}}
{{#invoke:DafYomi|date|month=7|day=31|year=2020|format=''[[%m (Talmud)|%m]]'', page %d}}
local p = {}
function p.today (frame)
return p.fromDate(os.date("!*t"))
end
function p.date (frame)
return p.fromDate(frame.args)
end
function p.fromDate (dat)
dat.hour = 0
dat.min = 0
dat.sec = 0
dat = os.time(dat)
local date0 = os.time({year=2005,month=2,day=28})
local sinceS = os.difftime(dat, date0) + 200
local sinceD = math.floor(sinceS / 86400)
return sinceD
end
return p