Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Module:Aligned dates list

Permanently protected module
From Wikipedia, the free encyclopedia
Module documentation[view] [edit] [history] [purge]
Thismodule is rated asready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned onhelp pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed throughsandbox testing rather than repeated trial-and-error editing.
Page extended-confirmed-protectedThis module is currently under extended confirmed protection.
Extended confirmed protection prevents edits from all unregistered editors and registered users with fewer than 30 days tenure and 500 edits. Thepolicy on community use specifies that extended confirmed protection can be applied to combat disruption, if semi-protection has proven to be ineffective. Extended confirmed protection may also be applied to enforcearbitration sanctions. Please discuss any changes on thetalk page; you maysubmit an edit request to ask for uncontroversial changes supported byconsensus.
WarningThis Lua module is used onapproximately 2,600 pages and changes may be widely noticed. Test changes in the module's/sandbox or/testcases subpages, or in your ownmodule sandbox. Consider discussing changes on thetalk page before implementing them.

Module:Aligned dates list is used to generate div elements with the month name and day number. Thus far it is primarily used withTemplate:Aviation accidents and incidents, however it could also be applied to similar navboxes.

Usage

{{#invoke:Aligned dates list|main}}

The abovedocumentation istranscluded fromModule:Aligned dates list/doc.(edit |history)
Editors can experiment in this module'ssandbox(edit |diff) and testcases(create) pages.
Subpages of this module.

localp={}functionp.main(frame)localoutput={}localmonthNames={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}localdaysInMonth={31,29,31,30,31,30,31,31,30,31,30,31}localfunctiongenerateSuffixes()localsuffixes={""}forchar=string.byte("b"),string.byte("z")dotable.insert(suffixes,string.char(char))endreturnsuffixesendlocalsuffixes=generateSuffixes()formonth=1,12dolocalmonthName=monthNames[month]localdays=daysInMonth[month]forday=1,daysdofor_,suffixinipairs(suffixes)dolocalkey1=string.format("%02d-%02d%s",month,day,suffix)localkey2=string.format("%s %02d%s",string.sub(monthName,1,3),day,suffix)localkey3=string.format("%s %02d%s",string.lower(string.sub(monthName,1,3)),day,suffix)localvalue=frame:getParent().args[key1]orframe:getParent().args[key2]orframe:getParent().args[key3]ifvaluethentable.insert(output,string.format('<div><div style="width:4em;display:inline-block;">%s %d</div> <div style="display:inline-block;">%s</div></div>',monthName,day,value))endendendendreturntable.concat(output)endreturnp
Retrieved from "https://en.wikipedia.org/w/index.php?title=Module:Aligned_dates_list&oldid=1279123075"
Categories:
Hidden category:

[8]ページ先頭

©2009-2025 Movatter.jp