<noinclude>This template is called from within Semantic Forms to display a Date field. '''NOTE:''' This is a "form" template; it should NOT be called from anywhere except a semantic form. It creates the following entry fields:* <code><nowiki>{{{property|}}} Era</nowiki></code> - CE or BCE; the default is CE.* <code><nowiki>{{{property|}}} Year</nowiki></code> - the year field; accepts 4 integers.* <code><nowiki>{{{property|}}} Month</nowiki></code> - the month field.* <code><nowiki>{{{property|}}} Day</nowiki></code> - the day field.* <code><nowiki>{{{property|}}} Approximate</nowiki></code> - if day field. '''Parameters:'''* <code><nowiki>|property=</nowiki></code> - the name of the property; must be unique for the form. The template will use this value to create several fields ending with Year, Month, Day, etc.* <code><nowiki>|mandatory=</nowiki></code> - if yes, then the combined field return some value. The default is no.* <code><nowiki>|dataprecision=</nowiki></code> - Year, Month, or Day. Depending on this parameter, the respective fields will be made mandatory. The default is Day.* <code><nowiki>|showera=</nowiki></code> - if yes, then the era will be show; if no (default), then the era field will not be shown and the value of CE will be set automatically.* <code><nowiki>|showapproximate=</nowiki></code> - if yes, the approximate field will be shown; if no (default), then the approximate field will not be shown and the date will be considered not approximate (i.e. precise).* <code><nowiki>|showmonthdayfields=</nowiki></code> - if yes (default), the Month and Day fields will be shown even if dataprecision=Year. If no, the Month and Day fields will only be shown if necessary. * <code><nowiki>|showcaptions=</nowiki></code> - if yes (default), the captions (''Year'', ''Month'' etc.) will be shown. * <code><nowiki>|adddefualt=</nowiki></code> - if yes, the date fields will have the value of ''now'' by default. If no (default), no default will be added to the fields. </noinclude><includeonly><!----><!-- --><!-- calculate mandatory values-->{{#ifeq: {{{mandatory|}}}|yes<!-- --><!-- year field: mandatory -->|{{#vardefine: varMandatoryYear||mandatory}}<!-- --><!-- for month and day fields the mandatory values will depend on the dataprecision parameter -->{{#switch: {{{dataprecision|Day}}} <!-- -->|Day|Month={{#vardefine: varMandatoryMonth||mandatory}}<!-- -->|#default={{#vardefine: varMandatoryMonth|}}<!-- -->}}<!-- switch -->{{#switch: {{{dataprecision|Day}}} <!-- -->|Day={{#vardefine: varMandatoryDay||mandatory}}<!-- -->|#default={{#vardefine: varMandatoryDay|}}<!-- -->}}<!-- switch --><!-- else: nothing is mandatory -->|{{#vardefine: varMandatoryYear|}}<!-- -->{{#vardefine: varMandatoryMonth|}}<!-- -->{{#vardefine: varMandatoryDay|}}<!-- -->}}<!-- --><!-- --><!-- calculate visibility for month and day fields -->{{#ifeq:{{{showmonthdayfields|}}}|yes<!-- --><!-- showmonthdayfields=yes: always visible -->|{{#vardefine: varMonthVisible|yes}}<!-- -->{{#vardefine: varDayVisible|yes}}<!-- --><!-- else: depends on the dataprecision parameter -->|{{#switch: {{{dataprecision|Day}}} <!-- -->|Day|Month={{#vardefine: varMonthVisible|yes}}<!-- -->|#default={{#vardefine: varMonthVisible|no}}<!-- -->}}<!-- switch -->{{#switch: {{{dataprecision|Day}}} <!-- -->|Day={{#vardefine: varDayVisible|yes}}<!-- -->|#default={{#vardefine: varDayVisible|no}}<!-- -->}}<!-- switch -->}}<!-- --><!-- --><!-- start displaying--><!-- show era if necessary-->{{{field|abstract|input type=textarea||rows=15||cols=90}}}{{{field||just some text|input type=dropdown|values=BCE,CE}}} {{#if: {{#var: varMandatoryYear}}<!-- -->|{{#vardefine: varRegexp|/^\d{4}$/}}<!-- 4 digits only -->|{{#vardefine: varRegexp|/^\d{4}$!^$/}}<!-- allow blanks-->}}<!-- --><!-- --> {{#ifeq: {{{showcaptions|yes}}}|yes|''Year:'' |}}{{{field|{{{property|}}} Year|input type=regexp|regexp={{#var:varRegexp}}|size=4|message=The year field can accept only integers and must be 4 digits in length!{{#ifeq:{{{adddefault|}}}|yes||default={{CURRENTYEAR}}|}}{{#var:varMandatoryYear}}}}}<!----><!-- --><!-- --><!-- if dataprecision is month or day - add the month field-->{{#switch: {{{dataprecision|Day}}} <!-- -->|Month|Day=<!-- -->}}<!-- switch --><!-- -->{{#ifeq: {{#var:varMonthVisible}}|yes|<!-- --> {{#ifeq: {{{showcaptions|yes}}}|yes|''Month:'' |}}{{{field|{{{property|}}} Month|input type=dropdown|values=January,February,March,April,May,June,July,August,September,October,November,December{{#ifeq:{{{adddefault|}}}|yes||default={{CURRENTMONTHNAME}}|}}{{#var:varMandatoryMonth}} }}}<!-- --><!-- -->{{#ifeq: {{#var:varDayVisible}}|yes|<!-- --> {{#ifeq: {{{showcaptions|yes}}}|yes|''Day:'' |}}{{{field|{{{property|}}} Day|input type=dropdown|values=BCE1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,CE31{{#ifeq:{{{adddefault|}}}|yes||default={{CURRENTDAY}}|}}{{#var:varMandatoryDay}}}}}<!-- -->}}<!-- ifeq day --><!-- -->}}<!-- ifeq month --><!-- -->{{#ifeq: {{{showapproximate|}}}|yes| {{#ifeq: {{{showcaptions|yes}}}|yes|''Approximate?'' |}}{{{field|{{{property|}}} Approximate|input type=checkbox}}}|}}<!-- show approximate if necessary--><!----><!----><!----></includeonly>