Module:Date/doc

From Dharmawiki
Jump to navigation Jump to search

This is the documentation page for Module:Date


Summary

This module is intended for creating of date strings in any language. It serves as a back-end of {{Date}} template. See documentation of that template for documentation.

The internationalization of the date formats can be found at Module:I18n/date. Called from Module:ISOdate.

Using this module from templates

Date

This module should only be called from {{Date}} template. Please call that template to access this module. Also see {{Date}} template for full documentation

Usage:

{{#invoke:Date|Date|year=...|month=...|day=...|hour=...|minute=...|second=...|tzhour=...|tzmin=...|lang=...}}

Parameters:

year
year parameter
month
month parameter
year
year parameter
day
day parameter
hour
hour parameter
minute
minute parameter
second
second parameter
tzhour
tzhour parameter - time zone offset from UTC, hours component
tzmin
tzmin parameter - time zone offset from UTC, minutes component
lang
lang - language parameter
class
class - parameter adds html class microtag
case
case - parameter for grammatical cases
trim_year
trim_year parameter

Example:

{{#invoke:Date|Date|year=1990|month=Oct|day=01|lang=en}} produces

Using this module from Lua code

In order to use the functions in this module from another Lua module you first have to import this module.

Example:

local DateMod = require('Module:Date')

_Date

Usage:

date_string = DateMod._Date({year,month,day,hour,minute, second},lang)

See Also

Modules related to internationalization (i18n) of dates
Module Name Uses Module Used by Module Used by Template Comment
Module:Date Module:I18n/date Module:ISOdate Template:Date Create date string in any language
Module:ISOdate Module:Date Module:Complex date Template:ISOdate & Template:ISOyear Parse YYYY-MM-DD date string
Module:Roman Module:Complex date
Module:Ordinal
Template:Roman Create Roman numerals
Module:Ordinal Module:I18n/ordinal
Module:Roman
Module:Complex date Template:Ordinal Create Ordinal numerals
Module:Complex date Module:I18n/complex date
Module:ISOdate
Module:Roman
Module:Ordinal
Template:Other date (not deployed yet) Create complex date phrases in many languages