Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Usage  





2 Options  





3 Adding or editing holidays  





4 Holidays with multiple aliases  





5 Dynamic dates  



5.1  Offset date  







6 Tracking categories  





7 VisualEditor TemplateData  





8 External links  














Template:Calendar date






Basa Bali

فارسی

Bahasa Indonesia


Bahasa Melayu

Scots

Simple English

اردو
Tiếng Vit
 

Edit links
 









Template
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 

(Redirected from Template:Moveable date)

{{Calendar date}} aka {{Moveable date}} is for displaying the calendar date of holidays or events that move annually, that do not have a fixed day and month of occurrence.

Examples include the Jewish new year Hanukkah which is based on a non-Gregorian calendar system. The June solstice wobbles celestially.

Usage

[edit]

The template requires only two arguments, the holiday/event name (|holiday=or|event= are synonymous) and the year |year= in the Gregorian calendar.

Example:

{{calendar date |holiday=Rosh Hashanah |year=2019}}
Produces:
Sunset, 29 September 2019 – nightfall, 1 October 2019

Optionally try |format=infobox in an infobox

Example:

{{Calendar date |holiday=Rosh Hashanah |year=2019 |format=infobox}}
Produces:
Sunset, 29 September –
nightfall, 1 October

Options

[edit]

Required

holiday or event
Name of an available holiday. Ex. |holiday=Rosh Hashanahor|event=Rosh Hashanah
year
Year of event. Ex. |year=2019

Options

df
Date Format options can be "dmy", "mdy" or "iso" (|df=dmy). Defaults are set in Module:Calendar date/events
format
Use |format=infobox in an infobox
cite
If set to anything (|cite=) a citation is added.

Adding or editing holidays

[edit]

Holidays are configured in Module:Calendar date/events which has additional documentation and examples.

There are two holiday types: "calculator" and "localfile".

calculator - Moveable dates are determined with a calculator plugin. For example Rosh Hashanah uses the {{Hebrew year}} calculator:

datatype = "calculator"
datasource = "{{#time:Y-m-d|@{{Hebrew year/rhdatum|{{#timel:xjY|YYYY-11-1}}}}-1 days}}"
When the template runs, it replaces "YYYY" with the value of the |year= argument, then executes the datasource code. Calculators can be any available on Wikipedia, so long as it accepts a year value and returns a date in ISO format. All calculators are third-party plugins, the template does not do calculations.

localfile - When a calculator is not possible or unavailable, moveable dates can be stored in local files. For example with Tu BiShvat:

datatype = "localfile"
datasource = "Module:Calendar date/localfiles/Tu BiShvat"
The file Module:Calendar date/localfiles/Tu BiShvat contains a static list of dates.

wikidata - <to be developed - see talk page for more info>

Holidays with multiple aliases

[edit]

If a holiday has multiple aliases, and it's desired the template support them with the |holiday= argument, create multiple entries in Module:Calendar date/events one for each name.

Dynamic dates

[edit]

The |year= can accept templates.

For example, to show the current year for Tu BiShvat use {{CURRENTYEAR}}:
{{Moveable date |holiday=Tu BiShvat |year={{CURRENTYEAR}}}}
Produces
Sunset, 24 January 2024 – nightfall, 25 January 2024

Other useful templates are {{LASTYEAR}} and {{NEXTYEAR}}.

Combined they can be used in infoboxes to fully automate updates, example from the Hanukkah infobox:

|date{{LASTYEAR}} = {{Moveable date |holiday=Hanukkah |year={{LASTYEAR}} |format=infobox |cite=}}
|date{{CURRENTYEAR}} = {{Moveable date |holiday=Hanukkah |year={{CURRENTYEAR}} |format=infobox}}
|date{{NEXTYEAR}} = {{Moveable date |holiday=Hanukkah |year={{NEXTYEAR}} |format=infobox}}
|date{{NEXTYEAR|2}} = {{Moveable date |holiday=Hanukkah |year={{NEXTYEAR|2}} |format=infobox}}

Offset date

[edit]

An offset date can be calculated for a given moveable date using #time parser function.

For example, to show the date of the Friday following Ascension Thursday:
{{Moveable date |holiday=Ascension Thursday |df=dM |year={{CURRENTYEAR}}}}
{{#time: d M Y| {{Moveable date |holiday=Ascension Thursday |df=d |year={{CURRENTYEAR}}}} + 1 day}}
Produces
9 May 2024
10 May 2024

Tracking categories

[edit]

VisualEditor TemplateData

[edit]

What is this? See https://www.mediawiki.org/wiki/Help:TemplateData

A template for displaying moving calendar dates

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Name of holiday/eventholiday

The name of the holiday or event

Example
Rosh Hashana
Stringrequired
Holiday yearyear

The year to display the holiday dates for

Example
2019
Stringrequired
Display format optionformat

Options for controlling display output such as for an infobox

Default
none
Example
infobox
Stringoptional
Date Formatdf

Date format to use when displaying dates

Default
dmy
Example
mdy
Stringoptional
[edit]

Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Calendar_date&oldid=856275031"

Categories: 
Lua-based templates
Time, date and calendar templates
Hidden categories: 
Templates in alpha
Templates that add a tracking category
 



This page was last edited on 24 August 2018, at 02:28 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki