Module:Calendar date/events
Appearance
![]() | This module is rated as alpha. It is ready for third-party input, and may be used on a few pages to see if problems arise, but should be watched. Suggestions for new features or changes in their input and output mechanisms are welcome. |
Usage
{{#invoke:Calendar date|function_name}}
local eventsdata = {}
--[[-------------------------< Holiday and Event configuration data > ------------------------------------
name = '' - Name of the holiday or event as given in the template "|holiday=" or "|event=" argument
description = '' - Short description of the holiday
days = '' - Number of days (string)
df = '' - Default date format (mdy,dmy,iso) - can be overridden by "|df=" in the template
datatype = '' - Where the date is obtained, "calculator" or "localfile"
datasource = '' - The data calculator; or a link to the local file
source = '' - Describe the source, used in creating citations.
If datatype = 'localfile' then:
citeurl = '' - URL where data was obtained
accessdate = '' - Date the data was generated
In addition some regional types may have their own custom options as detailed below.
Blank template:
[''] = {
name = '',
description = '',
days = ''
df = '',
source = '',
datatype = '',
datasource = ''
},
]]
--[[-------------------------< Hebrew calendar configuration data > ------------------------------------
Custom options for Hebrew calendar:
prepend1 = '' - Prepend text before the first (or only) date eg. "Sunset, <date>"
prepend2 = '' - Prepend before the last date eg. "Sunset, <date> - nightfall, <date>"
startoffset = '' - Offset the start day by this number (help account for 25hr cycle that starts at Sunset)
endoutoffset = '' - Offset the end day by this number, when the end day occurs outside of Israel
]]
local hebrew_calendar = {
['Rosh Hashana'] = {
name = 'Rosh Hashana',
description = 'The Jewish New Year',
days = '3',
df = 'dmy',
prepend1 = 'Sunset',
prepend2 = 'nightfall',
source = 'Date calculations by Wikipedia templates {{Calendar date}} and {{Hebrew year/rhdatum}}',
datatype = 'calculator',
datasource = '{{#time:Y-m-d|@{{Hebrew year/rhdatum|{{#timel:xjY|YYYY-11-1}}}}-1 days}}'
},
}
--- -------------------------< Misc holidays and events configuration data > ------------------------------------
local misc_events = {
['Labor Day'] = {
name = 'Labor Day',
description = 'Labor Day in the United States',
days = '1',
df = 'mdy',
citeurl = 'https://www.timeanddate.com/holidays/us/labor-day',
accessdate = '2018-08-27',
source = 'Public Domain information from timeanddate.com',
datatype = 'localfile',
datasource = 'Template:Calendar date/holidays/Labor Day.js'
},
}
return {hebrew_calendar=hebrew_calendar, misc_events=misc_events}