الگو:تاریخ پایان و سن/توضیحات

از ویکی‌پدیا، دانشنامهٔ آزاد
The {{تاریخ آغاز و سن}} template displays the date that an event or entity started or was created. It also includes a duplicate, machine-readable date in the ایزو ۸۶۰۱ format (which is hidden by شیوه‌نامه آبشاری), for use inside other templates which emit microformats. The hidden date degrades gracefully when CSS is not available.

استفاده[ویرایش]

Common usage
{{تاریخ آغاز و سن|yyyy|mm|dd}} برای نمایش :
۲۵ مارس ۲۰۱۰؛ ۱۴ سال پیش (۲۰۱۰-25}})
{{تاریخ آغاز و سن|yyyy|mm|dd|df=yes}} برای نمایش :
۲۵ مارس ۲۰۱۰؛ ۱۴ سال پیش (۲۰۱۰-25}})
Full syntax
{{تاریخ آغاز و سن|yyyy|mm|dd|df=yes|p=yes|br=yes}} برای نمایش :
۲۵ مارس ۲۰۱۰
(۱۴ سال پیش)
 (۲۰۱۰-25}})

پارامترها[ویرایش]

پارامتر حالت شرح
1 required A four-digit number indicating the year.
2 optional A number between 1 and 12 indicating the month (leading zeros in the number are ignored). The month may also be specified as a name or abbreviation (e.g. "August" or "Aug").
3 optional A number between 1 and 31 indicating the day of the month (leading zeros in the number are ignored).
df= optional If the parameter df equals yes, y, or 1, the date will be displayed in DMY format: 4 March 2010. When this parameter is not included or set to some other value, the date will be displayed in MDY format: March 4, 2010.
p=
paren=
optional If the parameter p or paren equals yes, y, or 1, the age will be displayed within parentheses. When this parameter is not included or set to some other value, the date and age are separated by a semicolon and a breaking space.
br= optional If the parameter br equals yes, y, or 1, a line break will be inserted between the date and the age. When this parameter is not included or set to some other value, a breaking space will be inserted between the date and the age. This does not change the separating characters between the date and age which are either a semicolon (default setting) or parentheses (if p=yes).

"df" (day first) and "mf" (month first)[ویرایش]

The default output of this template is to display the month before the day (MDY). This default may not be appropriate for articles about events or entities in parts of the world where dates are commonly given with the day preceding the month (DMY). To display the day first, assign the df parameter a value of yes, y, or 1 (e.g. df=yes).

If the default format is preferred, the parameter df may be used with value of no, n, or 0 (e.g. df=no). These values can assist bots or other automated processing to detect the intended date format; omitting the df parameter may lead an editor or bot to change the format to an unintended value.

The preference to display the month first may also be indicated via the parameter mf (e.g. mf=yes). While not actually used by the template, this is another method of indicating that the default format is intended. Do not specify both "df" and "mf" parameters in the same use of the template.

نمونه‌ها[ویرایش]

Default separator: semicolon[ویرایش]

ترکیب نتیجه
تاریخ کامل (سال، ماه، روز))
{{تاریخ آغاز و سن|2010|01|02}} ۲ ژانویه ۲۰۱۰؛ ۱۴ سال پیش (۲۰۱۰-02}})
{{تاریخ آغاز و سن|2008|Jan|09|df=no}} ۹ ژانویه ۲۰۰۸؛ ۱۶ سال پیش (۲۰۰۸-09}})
{{تاریخ آغاز و سن|2003|January|05|mf=yes}} ۵ ژانویه ۲۰۰۳؛ ۲۱ سال پیش (۲۰۰۳-05}})
{{تاریخ آغاز و سن|2010|1|2|df=yes}} ۲ ژانویه ۲۰۱۰؛ ۱۴ سال پیش (۲۰۱۰-02}})
{{تاریخ آغاز و سن|2008|Jan|9|df=y}} ۹ ژانویه ۲۰۰۸؛ ۱۶ سال پیش (۲۰۰۸-09}})
{{تاریخ آغاز و سن|2003|January|5|df=1}} ۵ ژانویه ۲۰۰۳؛ ۲۱ سال پیش (۲۰۰۳-05}})
100 days ago:
{{تاریخ آغاز و سن|۲۰۲۴|۱|۷}}
۷ ژانویه ۲۰۲۴؛ ۳ ماه پیش (۲۰۲۴-0۷}})
Yesterday:
{{تاریخ آغاز و سن|۲۰۲۴|۴|۱۵}}
۱۵ آوریل ۲۰۲۴؛ ۱ روز پیش (۲۰۲۴-۱۵}})
Today:
{{تاریخ آغاز و سن|۲۰۲۴|۴|۱۶}}
۱۶ آوریل ۲۰۲۴؛ ۰ روز پیش (۲۰۲۴-۱۶}})
سال و ماه
{{تاریخ آغاز و سن|2001|9}} سپتامبر ۲۰۰۱؛ ۲۲ سال پیش (۲۰۰۱}})
{{تاریخ آغاز و سن|2002|09}} سپتامبر ۲۰۰۲؛ ۲۱ سال پیش (۲۰۰۲}})
{{تاریخ آغاز و سن|2003|Sep}} سپتامبر ۲۰۰۳؛ ۲۰ سال پیش (۲۰۰۳}})
{{تاریخ آغاز و سن|2004|September}} سپتامبر ۲۰۰۴؛ ۱۹ سال پیش (۲۰۰۴}})
فقط سال
{{تاریخ آغاز و سن|2005}} ۲۰۰۵؛ ۱۹ سال پیش (۲۰۰۵-خطا: زمان نامعتبر}})

Optional separator: parentheses[ویرایش]

Syntax نتیجه
Full date (year, month, day)
{{تاریخ آغاز و سن|2003|02|15|p=yes}} ۱۵ فوریه ۲۰۰۳ (۲۱ سال پیش) (۲۰۰۳-15}})
{{تاریخ آغاز و سن|2003|02|15|df=y|p=y}} ۱۵ فوریه ۲۰۰۳ (۲۱ سال پیش) (۲۰۰۳-15}})
Year and month
{{تاریخ آغاز و سن|2003|02|p=1}} فوریه ۲۰۰۳ (۲۱ سال پیش) (۲۰۰۳}})
Year only
{{تاریخ آغاز و سن|2003|paren=yes}} ۲۰۰۳ (۲۱ سال پیش) (۲۰۰۳-خطا: زمان نامعتبر}})

Line break with semicolon[ویرایش]

Syntax نتیجه
Full date (year, month, day)
{{تاریخ آغاز و سن|2003|02|15|br=yes}} ۱۵ فوریه ۲۰۰۳؛
۲۱ سال پیش
 (۲۰۰۳-15}})
{{تاریخ آغاز و سن|2003|02|15|df=y|br=y}} ۱۵ فوریه ۲۰۰۳؛
۲۱ سال پیش
 (۲۰۰۳-15}})
Year and month
{{تاریخ آغاز و سن|2003|02|br=1}} فوریه ۲۰۰۳؛
۲۱ سال پیش
 (۲۰۰۳}})
Year only
{{تاریخ آغاز و سن|2003|br=yes}} ۲۰۰۳؛
۲۱ سال پیش
 (۲۰۰۳-خطا: زمان نامعتبر}})

Line break with parentheses[ویرایش]

Syntax نتیجه
Full date (year, month, day)
{{تاریخ آغاز و سن|2003|02|15|p=yes|br=yes}} ۱۵ فوریه ۲۰۰۳
(۲۱ سال پیش)
 (۲۰۰۳-15}})
{{تاریخ آغاز و سن|2003|02|15|df=y|p=y|br=y}} ۱۵ فوریه ۲۰۰۳
(۲۱ سال پیش)
 (۲۰۰۳-15}})
Year and month
{{تاریخ آغاز و سن|2003|02|p=1|br=1}} فوریه ۲۰۰۳
(۲۱ سال پیش)
 (۲۰۰۳}})
Year only
{{تاریخ آغاز و سن|2003|paren=yes|br=yes}} ۲۰۰۳
(۲۱ سال پیش)
 (۲۰۰۳-خطا: زمان نامعتبر}})

Supporting templates[ویرایش]

Use in microformats[ویرایش]

This template also returns the date, hidden by CSS, in the ایزو ۸۶۰۱ format needed by one or more of the following microformats:

usually, but not always, within infobox or similar templates, or tables.

Its use in hCard is for organisations, venues and similar; use {{Birth date}} or {{Birth date and age}} for people.

Similarly, {{End date}} returns the date as hCalendar's (class="dtend").

See the microformats project for further details.

Limitation[ویرایش]

This template has no provision to deal with a date in a non-Gregorian calendar. Also, ایزو ۸۶۰۱ requires mutual agreement among those exchanging information before using years outside the range 1583–9999 CE. Therefore, use of this template for non-Gregorian dates or dates outside that range constitutes a false claim of conformance to the ISO 8601 standard.

Any editor encountering such usage should change the date to plain text with no template; or if not confident in doing so, raise the matter on this template's talk page.

داده‌های الگو[ویرایش]

این، توضیحاتِ الگوداده است که توسط TemplateWizard، ویرایشگر دیداری و دیگر ابزارها استفاده می‌شود. گزارش خطای ماهیانه برای این الگو را ببینید.

الگوداده تاریخ پایان و سن

الگوی تاریخ پایان و سن تاریخ پایان یافتن یک رویداد، فعالیت یک سازمان و غیره را به‌همراه زمان سپری‌شده از زمان پایان یافتن آن تاکنون نمایش می‌دهد.

پارامترهای الگو

استفاده از قالب‌بندی درون‌خطی برای پارامترهای این الگو ارجح است.

پارامترتوضیحاتنوعوضعیت
سال1

یک عدد چهار رقمی که نمایندهٔ سال است

مثال
۲۰۱۷
شمارهضروری
ماه2

عددی بین ۱ و ۱۲ که نمایندهٔ ماه است

مثال
۱۲
شمارهپیشنهادشده
روز3

عددی بین ۱ و ۳۱ که نمایندهٔ روز مورد نظر در یکی از ماه‌های سال است

مثال
۳۱
شمارهپیشنهادشده
نمایش با پرانتزپرانتز پ paren p

اگر این پارامتر برابر با «yes» «y»، «بله» یا «1» باشد، سن در داخل پرانتز نمایش داده می‌شود. اگر این پارامتر به‌کار نرفته باشد یا روی مقدارهای دیگری تنظیم شده باشد، تاریخ و سن با یک نقطه‌ویرگول و یک فاصلهٔ نشکن از یکدیگر جدا می‌شوند.

پیش‌فرض
no
مثال
بله
بولیاختیاری
سن در سر خطسخ br

اگر پارامتر سخ (سرخط) برابر با «yes» «y» «بله» یا «1» باشد، تاریخ و سن هریک در سطری جداگانه درج می‌شوند. اگر این پارامتر به‌کار نرفته باشد، یا روی مقدار دیگری تنظیم شده‌باشد، یک فاصلهٔ ساده (شکننده) بین تاریخ و سن درج می‌شود. این پارامتر روی نویسهٔ جداکنندهٔ تاریخ و سن، که ممکن است نقطه‌ویرگول (تنظیم پیش‌فرض) یا پرانتز (در صورت استفاده از «پرانتز=بله») باشد، تأثیری نمی‌گذارد.

پیش‌فرض
خیر
مثال
بله
بولیاختیاری

See also[ویرایش]