Module:Upcoming Birthdays

From NOISZ Wiki
Revision as of 11:29, 29 September 2025 by RiceEmpress (talk | contribs)

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

local capiunto = require 'capiunto'
local lang = mw.language.getContentLanguage()
local currentYear = lang:formatDate("Y")
local currentDay = os.time()

local p = {}

local function sortBirthdays( a, b )
    return a[2] > b[2];
end


function p.main()

	birthdays = {}
	birthdays[1] = {'Hikari Aoki',os.difftime(os.time{year=currentYear,month=01,day=22},currentDay)/86400}
	birthdays[2] = {'Sera Hoshikawa',os.difftime(os.time{year=currentYear,month=03,day=14},currentDay)/86400} 
	birthdays[3] = {'Grace Kamenashi',os.difftime(os.time{year=currentYear,month=04,day=01},currentDay)/86400}
	birthdays[4] = {'Arietta Antiphon',os.difftime(os.time{year=currentYear,month=06,day=18},currentDay)/86400}
	birthdays[5] = {'Joker',os.difftime(os.time{year=currentYear,month=06,day=18},currentDay)/86400}
	birthdays[6] = {'Asuka Fujita',os.difftime(os.time{year=currentYear,month=07,day=30},currentDay)/86400}
	birthdays[7] = {'Sumire Hitori',os.difftime(os.time{year=currentYear,month=09,day=09},currentDay)/86400}
	birthdays[8] = {'Hitori',os.difftime(os.time{year=currentYear,month=09,day=09},currentDay)/86400}
	birthdays[9] = {'Hakuno Nekoda',os.difftime(os.time{year=currentYear,month=12,day=25},currentDay)/86400}
	birthdays[10] = {'Shion Nekoda',os.difftime(os.time{year=currentYear,month=12,day=29},currentDay)/86400}
	birthdays[11] = {'Hikari Aoki',os.difftime(os.time{year=currentYear+1,month=01,day=22},currentDay)/86400}
	birthdays[12] = {'Sera Hoshikawa',os.difftime(os.time{year=currentYear+1,month=03,day=14},currentDay)/86400} 
	table.sort(birthdays, sortBirthdays)
	return mw.dumpObject(birthdays)
end
return p