"Module:Year in other calendars/doc" की अवतरण में अंतर

छो
Bot: Replace deprecated <source> tag and "enclose" parameter [https://lists.wikimedia.org/pipermail/wikitech-ambassadors/2020-April/002284.html]
छो (→‎इहो देखल जाय: छोट अनुबाद, replaced: == See also == → == इहो देखल जाय == using AWB)
छो (Bot: Replace deprecated <source> tag and "enclose" parameter [https://lists.wikimedia.org/pipermail/wikitech-ambassadors/2020-April/002284.html])
 
To display one year:
 
<div style="overflow: auto;"><sourcesyntaxhighlight lang="lua">
local myCalendar = calendar:new()
myCalendar:setLink( 'My calendar article' ) -- The name of the calendar's Wikipedia article.
myCalendar:setYear( year + 10 ) -- Lua code linking the Gregorian calendar year to your calendar's year.
box:addCalendar( myCalendar )
</sourcesyntaxhighlight></div>
 
To display a year range:
 
<div style="overflow: auto;"><sourcesyntaxhighlight lang="lua">
local myCalendar = calendar:new()
myCalendar:setLink( 'My calendar article' ) -- The name of the calendar's Wikipedia article.
myCalendar:setYearRange( year + 10, year + 11 ) -- Lua code outputting the start year and the end year of the year range.
box:addCalendar( myCalendar )
</sourcesyntaxhighlight></div>
 
More complicated calendars can be passed as a string to <code>calendar:setYear()</code>.
 
To load these classes from another module, use the following:
<div style="overflow: auto;"><sourcesyntaxhighlight lang="lua">
local yearInOtherCalendars = require( 'Module:Year in other calendars' )
local calendarBox = yearInOtherCalendars.calendarBox
local calendarGroup = yearInOtherCalendars.calendarGroup
local calendar = yearInOtherCalendars.calendar
</sourcesyntaxhighlight></div>
 
==== calendarBox class ====
6,611

संपादन सभ