If you have made any changes to the code of this template you need to
to see the changes in these examples.THIS IS A SANDBOX TEST for update to {{ Date style}}, see its intended documentation Template:Date style/doc
{{User:Davidruben/sandbox7|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=2008-01-01|date=2008-01-01}}
Generates: " Example". Example Inc. (1 January 2008). Retrieved on 1 January 2008.
NO red-linked dates, i.e. 2008-01-01, if a user has no date preference set, in this example where hard coded date stylining (so why previously failed using a metatemplate for simpler coding ?) David Ruben Talk 17:37, 14 July 2008 (UTC)
NB meta:Help:Date_formatting_and_linking#Accessibility of date preference for branching states "The date format cannot be detected with #ifeq, because the date format is converted after expansion of parser functions." so not possible, it seems to detect user date format within a parser function. Is this why pervious metatemplate works on its own but not within another parser fuction ? Get rid of format test therefore in this example - hence entries either:
{{User:Davidruben/sandbox7|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=2008-01-01|date=2008-01-01|datestyle=}}
Generates: " Example". Example Inc. (1 January 2008). Retrieved on 1 January 2008.
{{User:Davidruben/sandbox7|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=2008-01-01|date=2008-01-01|datestyle=dmy}}
Generates: " Example". Example Inc. (1 January 2008). Retrieved on 1 January 2008.
{{User:Davidruben/sandbox7|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=2008-01-01|date=2008-01-01|datestyle=mdy}}
Generates: " Example". Example Inc. (1 January 2008). Retrieved on 1 January 2008.
{{User:Davidruben/sandbox7|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=2008-01-01|date=2008-01-01|datestyle=ymd}}
Generates: " Example". Example Inc. (1 January 2008). Retrieved on 1 January 2008.
Because Unix cannot handle dates before 1970, these can not be converted into date styles by the wikipedia parserfunction {{#time: }} function:
However early dates can be wikified:
Hence where datestyle is defined, we need to trap dates before 1970. This is done by an initial test date styling and seeing if the outcome is 1970-01-01, in which case no formating is applied and the date is shown as unlinked free text:
{{User:Davidruben/sandbox7|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=1935-01-01|date=1935-01-01|datestyle=dmy}}
Generates: " Example". Example Inc. (1 January 1935). Retrieved on 1 January 1935.
Some examples of where dates wrongly formated or presented already partly wikilinked (datestyle set to "mdy" throughout). All result in some form of a date being shown (ie no "error" is seen to occur). In practice any date value that can not be formated (as is the case if already manually part wikilinked) is show directly as that parameter value (i.e. the wikilinked value itself). Hence in examples below "3rd February 2008" can be formated and so this is undertaken, but the template and parser functions do not reconginse say "[[20 May]] [[2007]]", "[[20 May]],[[2007]]" or "[[20 May]] of the year [[2007]]" and these are shown directly as entered. This show as-is if any sort of error is needed to cope with MediaWiki's bugs of not being able to handle dates before 1901.
Finally compare handling for a pre-1901 date:
If you have made any changes to the code of this template you need to
to see the changes in these examples.THIS IS A SANDBOX TEST for update to {{ Date style}}, see its intended documentation Template:Date style/doc
{{User:Davidruben/sandbox7|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=2008-01-01|date=2008-01-01}}
Generates: " Example". Example Inc. (1 January 2008). Retrieved on 1 January 2008.
NO red-linked dates, i.e. 2008-01-01, if a user has no date preference set, in this example where hard coded date stylining (so why previously failed using a metatemplate for simpler coding ?) David Ruben Talk 17:37, 14 July 2008 (UTC)
NB meta:Help:Date_formatting_and_linking#Accessibility of date preference for branching states "The date format cannot be detected with #ifeq, because the date format is converted after expansion of parser functions." so not possible, it seems to detect user date format within a parser function. Is this why pervious metatemplate works on its own but not within another parser fuction ? Get rid of format test therefore in this example - hence entries either:
{{User:Davidruben/sandbox7|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=2008-01-01|date=2008-01-01|datestyle=}}
Generates: " Example". Example Inc. (1 January 2008). Retrieved on 1 January 2008.
{{User:Davidruben/sandbox7|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=2008-01-01|date=2008-01-01|datestyle=dmy}}
Generates: " Example". Example Inc. (1 January 2008). Retrieved on 1 January 2008.
{{User:Davidruben/sandbox7|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=2008-01-01|date=2008-01-01|datestyle=mdy}}
Generates: " Example". Example Inc. (1 January 2008). Retrieved on 1 January 2008.
{{User:Davidruben/sandbox7|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=2008-01-01|date=2008-01-01|datestyle=ymd}}
Generates: " Example". Example Inc. (1 January 2008). Retrieved on 1 January 2008.
Because Unix cannot handle dates before 1970, these can not be converted into date styles by the wikipedia parserfunction {{#time: }} function:
However early dates can be wikified:
Hence where datestyle is defined, we need to trap dates before 1970. This is done by an initial test date styling and seeing if the outcome is 1970-01-01, in which case no formating is applied and the date is shown as unlinked free text:
{{User:Davidruben/sandbox7|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=1935-01-01|date=1935-01-01|datestyle=dmy}}
Generates: " Example". Example Inc. (1 January 1935). Retrieved on 1 January 1935.
Some examples of where dates wrongly formated or presented already partly wikilinked (datestyle set to "mdy" throughout). All result in some form of a date being shown (ie no "error" is seen to occur). In practice any date value that can not be formated (as is the case if already manually part wikilinked) is show directly as that parameter value (i.e. the wikilinked value itself). Hence in examples below "3rd February 2008" can be formated and so this is undertaken, but the template and parser functions do not reconginse say "[[20 May]] [[2007]]", "[[20 May]],[[2007]]" or "[[20 May]] of the year [[2007]]" and these are shown directly as entered. This show as-is if any sort of error is needed to cope with MediaWiki's bugs of not being able to handle dates before 1901.
Finally compare handling for a pre-1901 date: