Template talk:As of

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Inline Templates
This template is within the scope of WikiProject Inline Templates, a collaborative effort to improve and manage Wikipedia's inline footnote, cleanup and dispute templates. If you would like to participate, you can visit the project page, where you can join the project and see a list of open tasks.
Some discussion of this template may take place at the project's talk page, rather than here.
 

Why autoadd http:// ?[edit]

Resolved: Template no longer adds http:// protocol to urls, documentation reflects now this.

Is there a technical reason for the template to add http:// in front of the provided url. Most editors would probably expect they had to include http:// - if that is actually what they want. It could also be https:// or ftp:// PrimeHunter (talk) 02:08, 5 August 2008 (UTC)

Sorry, overlooked that, the template now requires editors to specify the protocol. Note that if the protocol is not given, the external link is not wikified and the template appears broken, the autoadd was a cheap way to avoid this. Thanks – Ikara talk → 02:24, 5 August 2008 (UTC)

Twentieth Century category[edit]

With regards to the recent creation of Category:Articles containing potentially dated statements from the twentieth century (note – incorrect capitalisation) and the modification of this template to include it, I have created this section on the talk page for discussion of the change. Currently I have reverted it as unnecessary (it leaves the general category almost unpopulated) and do not see a need for such a category, but if someone has a sufficient reason to create one I will be happy for them or myself to recreate the changes. Thanks – Ikara talk → 17:31, 3 September 2008 (UTC)

The general category is Category:All articles containing potentially dated statements. Category:Articles containing potentially dated statements should be empty, the same as (for example) Category:Articles to be expanded. Incidentally, we do not capitalise the names of centuries or millennia. If you can think of a better title, or different approach (e.g. "1901-1989" and "before 1901", or simply "pre-1989", feel free to move/swap/change as appropriate.
Rich Farmbrough, 11:37 4 September 2008 (GMT).
Alright, I would suggest simply using Category:Articles containing potentially dated statements from before 1990. This conforms to the naming style used in the other categories, and is more accurate than "twentieth century" in this case. It also deals with the odd case where an "as of" statement originates from before 1901, currently one exists and is still placed in the top-level category. The wording on CAT:ASOF (and possibly WP:As of) should be updated to reflect the change. – Ikara talk → 15:54, 4 September 2008 (UTC)

All necessary updates have been made. All that remains is to delete Category:Articles containing potentially dated statements from the twentieth century when it is empty. I'll leave it for four days and then mark it for deletion per CSD C1 (again), provided there are no further qualms about the layout and/or naming of the categories. Sorry for interfering like that – Ikara talk → 16:27, 4 September 2008 (UTC)

That's good. I'll speedy the cat. Rich Farmbrough, 01:47 6 September 2008 (GMT).

How to detect this template in an article?[edit]

Resolved: Optional tags added to all transclusions of tags template.

When I see e.g. "As of 2008" in an article, I can't tell whether this is a transclusion of {{As of|2008}} or it's just plain literal "As of 2008" - at least not short of looking at the source (or at the hidden categories at the bottom). This is a flaw as far as editors are concerned, because it discourages tagging dated statements with this template: unlike the previous solution with wikilinks, it's not clear whether the statement needs tagging or not. Could there be a CSS solution, like .asof-tag? GregorB (talk) 03:35, 7 September 2008 (UTC)

Thanks for bringing this to my attention, it is a very valid criticism. I believe I have resolved it now; all users who have the .asof-tag line in their CSS pages will now see an [update] tag in the place of the [ref] tag when the {{as of}} template is transcluded without the url parameter being provided. The tag is an edit link, providing another way for editors to quickly update statements. If editors want to retain the use of [ref] tags but do not want to see the [update] tags, or vice versa, there are alternatives at WP:As of. This provides a subtle visual indicator that the template is in use for those who want it. Cheers – Ikara talk → 19:10, 7 September 2008 (UTC)
I've noticed a couple of minutes ago that this issue has been resolved, as I had already updated my monobook.css with the .asof-tag style. This is overall an excellent solution, much better - both more powerful and less intrusive - than the old one that was based on wikilinks. Thank you for making this last step! GregorB (talk) 19:21, 7 September 2008 (UTC)
Your welcome, I'm glad to see editors making full use of this template – Ikara talk → 19:59, 7 September 2008 (UTC)

Parameters?[edit]

I'm afraid I made several dozen edits like e.g. {{As of|September 2008}} before realizing {{As of|2008|9}} is actually correct... The first form works correctly, though, because the template currently does not rely on the first parameter being actually a number. The first form is also more readable and makes replacing the current "As of" links somewhat easier... However, I understand that it is apparently impossible to programatically extract ordinal month from strings such as "September 2008", which is why it is perhaps not a good thing. Comments? GregorB (talk) 19:17, 18 September 2008 (UTC)

Actually, after some considerable fiddling, I have succeeded to extract the (month and) year from strings like "September 2008", which is why the template allows non-numerical first parameters. It involved using the {{#time:<param>}} function, and will work for any readable date string, particularly those of the form mentioned. However its usage is deprecated and discouraged as it is more likely to create errors through typos; if you want a more readable layout you could instead use {{As of|2008|September}}. If you do use the string form, please ensure that the month is capitalised and spelt correctly. All the best – Ikara talk → 19:56, 18 September 2008 (UTC)
Thanks. Will keep that in mind... GregorB (talk) 07:04, 19 September 2008 (UTC)

Mention of "as of" in FAC discussion[edit]

Please see Wikipedia:Featured article candidates/Congregation Beth Elohim where the "as of" feature has been discussed and (I think) misunderstood. See also my comments here, here, and here. If those maintaining this template could comment, that might help clarify things. Carcharoth (talk) 09:16, 5 October 2008 (UTC)

Display of abbreviated month name[edit]

There are times when one may want the abbreviated month name to be displayed. For instance, I could sometimes want "August" to be displayed as "Aug." or "Aug". The only way to do this now is using the alt parameter. Could you introduce an additional named parameter which a user could use to indicate the desired display format for the date – similar to how programming languages ask for a date string to be formatted? --AB (talk) 22:55, 22 November 2008 (UTC)

df parameter not working?[edit]

{{as of|2009|8|3|df=US|lc=yes}} returns as of 3 August  2009 (2009 -08-03), which has a little endian date instead of a US-style middle-endian date. --an odd name 07:15, 3 August 2009 (UTC)

Indeed, this is broken across the encyclopedia for no reason I can discern. - Dravecky (talk) 05:05, 6 August 2009 (UTC)
UPDATE: There was a code change made to {{Start date}} that is the apparent culprit. I have left a note on that template's talk page encouraging a reversion to working code or a fix to return the US-style date formatting to operational status. Other interested editors may also wish to weigh in on the topic. - Dravecky (talk) 06:09, 6 August 2009 (UTC)

df parameter value[edit]

We need to change the df parameter to recognize "MDY" as a value, in addition to being able to use "US". The main issue is that using "US" causes unnecessary issues among editors. There's nothing about the "Month DD, year" format which is specifically American anyway; it's just a date formatting style (which currently happens to be preferred in the US, by Microsoft at least... and by myself, usually).

The code in the sandbox has the df=MDY capability added. If someone could make those changes live, then great. If there are potential problems, let's talk about them.
— V = IR (Talk • Contribs) 04:37, 22 March 2010 (UTC)

Example Ambiguity[edit]

2008/7/5 can represent either 5 May 2008 or July 5, 2008. I would edit this myself to read 2010/23/5 which is unambiguous, but I can't since it is locked.

Nick Beeson (talk) 10:11, 8 May 2010 (UTC)

Proposal: named param "version=1.2.3"[edit]

I would like to have an option like ''version=1.2.3. This should be software-based (that is: each number can only go up, periods are optional, and more). Problem could be it is numbers & text mixed. My example and primary concern is Unicode. But if we can handle dates, we can handle software, innit. IMO, {{as of}} should be the MAIN template to go to. -DePiep (talk) 19:01, 31 August 2010 (UTC)

Edit request from 67.180.234.70, 12 September 2010[edit]

  1. REDIRECT Template:Edit protected/preload

Please correct map of India. It is not showing properly parts of Undia. —Preceding unsigned comment added by 67.180.234.70 (talk) 21:35, 12 September 2010 (UTC)

Which categories?[edit]

Could the /doc describe just in which category (-tree) the page ends up? -DePiep (talk) 22:05, 19 September 2010 (UTC)

quarter[edit]

How about adding an option for specifying a quarter? Of course one can use {{As of|2010|3|alt=As of Q1 2010}}: As of Q1 2010, but would it serve the same purpose?--Muhandes (talk) 09:40, 21 September 2010 (UTC)

Small case "as"[edit]

Please make the template recognize when a small case "a" is used for "as of" for use within a sentence. Currently this forces the editor to not use this template in that situation and use the {Update after} alone. Veriss (talk) 21:34, 25 October 2010 (UTC)

I found the switch. Veriss (talk) 02:19, 29 October 2010 (UTC)

Edit request from Nnemo, 26 June 2011 — Non-breaking spaces[edit]

Hello,

For correct typography, conform to WP:MOS, please put "&nbsp;" — non-breaking space — where necessary so that the template generate:

  • 23&nbsp;March&nbsp;2011
  • March&nbsp;2011

Thanks,

--Nnemo (talk) 01:45, 26 June 2011 (UTC)

Where in this template are there non-breaking spaces? And where should there be? I think you don't understand either this template, or WP:MOS. Debresser (talk) 01:54, 26 June 2011 (UTC)
I'm not sure MOS really requires it, but even if it does, the template uses {{Start date}} to display all dates, so any request to change the date formatting will have to be made there. --Muhandes (talk) 12:42, 26 June 2011 (UTC)
I understand that:
I put the parameter alt in an article. Because I had disturbingly read "March 2011" separated by a soft line break.
--Nnemo (talk) 15:12, 26 June 2011 (UTC)

Malfunctioning?[edit]

Timmins Fire Department only has an as of from 2005, but it's listed in Category:Articles containing potentially dated statements from before 1990. -- Beland (talk) 16:49, 3 July 2011 (UTC)

It was dated the 2005th day of January, the first year of CE. Fixed. Debresser (talk) 16:57, 3 July 2011 (UTC)

Removing case sensitivity from df[edit]

{{Edit protected}}

Replace:

df={{#ifeq:{{{df|}}}|US||yes}}

with:

df={{#ifeq:{{lc:{{{df|}}}}}|us||yes}}

Reason: Remove case sensitivity to the value of |df=. —Farix (t | c) 22:13, 15 July 2011 (UTC)

Done. --Closedmouth (talk) 13:10, 18 July 2011 (UTC)

Comma when capitalised[edit]

If this template is used at the beginning of a sentence, it starts with a capital 'a'. In this case, it should has a trailing comma, like As of February 2010, zlib supports only one algorithm.... Sae1962 (talk) 14:12, 29 February 2012 (UTC)

Sure, but that comma is already in place in countless articles. Changing the behavior of the template will result in a heck of a lot of double-commas without significant benefit to users of the template. - Dravecky (talk) 15:40, 29 February 2012 (UTC)

US date format NOT as default? etc[edit]

  1. As most movie pages on WP are rather likely to be of United States origin, (correct me if i'm wrong! Bollywood perhaps?) wouldn't it be useful to have US date format (mm-dd-yyyy) as the default? (and I'm not from the US, so my normal date format is dd-mm-yyyy which is the current template default). nb. in this case I was trying to edit a page that used US date format, John Carter (film).
  2. When trying to use the "alt=" parameter thus: {{as of|2012|6|28|lc=y|df=US|alt=up to}}, to display "for a worldwide total up to June 28, 2012 of $282,778,100", rather than "as of June 28, 2012", I found the date was not appearing, ie. displaying exactly as "for a worldwide total up to of $282,778,100". Any way around this, or is my syntax faulty?
The edit I made is here. - 220 of Borg 20:06, 21 August 2012 (UTC)
Symbol opinion vote.svg- Nearly 3 weeks since I asked this question. Any 'takers'? :-/ - 220 of Borg 16:09, 7 September 2012 (UTC)
  1. Some templates default to one date format others to the other, some default to US spelling others to the spelling of the rest of the World, some default to format numbers with commas others with spaces. There is no right or wrong way and it gets to a point where changing from one to another becomes tedious. This template is way past that point. However, I'm making a suggestion below that would make the question moot.
  2. The doc isn't all that clear but |alt= may be meant to act like that.
Jimp 17:34, 26 May 2015 (UTC)

category is not hidden[edit]

Just to let you know this is what I see in the un-hidden categories of Hurricane Isaac (2012) after the As Of template has been used: Category:Articles containing potentially dated statements from 12 P.M Ottawahitech (talk) 22:55, 30 August 2012 (UTC)

That is because the category "Articles containing potentially dated statements from 12 P.M" shouldn't exist. You should enter dates only, no times. Debresser (talk) 23:21, 30 August 2012 (UTC)
Fixed that usage. Debresser (talk) 23:23, 30 August 2012 (UTC)
Yes, I saw you did. What I was hoping for, though, is consideration given to allow the template to be used with a time as well as with a date, or to creation of a new template for such use. Ottawahitech (talk) 03:03, 31 August 2012 (UTC)
It is not so easy to do this. Also, I assume that Wikipedia does not consider this necessary. After all, you can always write simply "As of 4pm" etc. Templates are not used for things that change so quickly. Debresser (talk) 13:05, 31 August 2012 (UTC)
A reason for using the template instead of writing plain text is to put articles in maintenance categories like Category:Articles containing potentially dated statements from August 2012. Such categories based on time of day would be too specific. The template already has the alt parameter to display different text. {{As of|2012|August|30|alt=As of 11 pm}} produces As of 11 pm, and (when used on an article) puts the article in Category:Articles containing potentially dated statements from August 2012. PrimeHunter (talk) 13:57, 31 August 2012 (UTC)

df param and consistency with other templates[edit]

I routinely use the {{Birth date}}, {{Death date}}, etc. templates. Their method of controlling date format is different than this one ({{As of}}), so I find myself having to look it up a lot. It would be nice if they were consistent with each other.

{{Birth date}} sets date format by the presence of |df= (set to anything) to set date-first instead of the default month-first format. The documentation also says that |mf=y sets month-first format, but since this format is the default, there is no actual code required (and both parameters being present is undefined). Normally, I follow the doc and set either |df=y or |mf=y.

Currently, |df=y for this ({{As of}}) template is not a defined value and therefore causes it to use the default, which is (fortunately) day-first. All that would be required to make it consistent with the behavior of {{Birth date}} etc. is to make |mf=anything set month-first (i.e. the same as |df=US). Documentation would be changed to say that |df= y or yes sets day-first or |mf= y or yes sets month-first (in addition to the existing |df=US). Thoughts? —[AlanM1(talk)]— 09:52, 11 July 2013 (UTC)

Unfortunately, when making these templates, different people used "df" as an abbreviation for two differing (but related) concepts. One was "day first", the other "date format". Some templates - the {{cite xxx}} family - used the more explicit |dateformat= for the latter, together with the supposedly-unambiguous values dmy mdy or ymd - but still people misunderstood its purpose. --Redrose64 (talk) 10:53, 11 July 2013 (UTC)
It's time do away with these parameters. Jimp 18:00, 26 May 2015 (UTC)

Creating a "currently" template[edit]

See proposal to use {{Currently}} as something along the lines of {{subst:As of|{{subst:CURRENTYEAR}}|{{subst:CURRENTMONTH}}|{{subst:CURRENTDAY}}|alt=currently}}, plus lower/upper case handling. (Would recommend that it be subst:ed.) TheFeds 00:43, 28 July 2013 (UTC)

I've implemented essentially what you describe, though without the alt=currently part, at Template:asofnow. --Anders Feder (talk) 04:42, 7 March 2015 (UTC)

(Trivial) Why is "lc=y" recommended syntax?[edit]

This is a fairly trivial point, and probably applies to several templates.

Template documentation says lc – optional; gives lower case "as of date" when defined; recommended syntax is lc=y

Why is "lc=y" the syntax recommended in documentation? "lc" by itself is both necessary and sufficient; appending "=<anything>" is redundant and ignored. My objection is not just because the "=y" (or "=on") is unnecessary, but because recommending "lc=y" implies that "lc=n" is syntax, though optional and unnecessary, to disable lower-casing. However, "lc=y", "lc=n", "lc=on", lc="off", and "lc=parsnip". are all synonymous.

I'm suggesting that documentation and policy be changed, rather then templates. It can be argued that the wording is legally correct (lc - optional), but this isn't what is remembered. I tried to use "lc=n" as a reminder in an As of that might be moved away from the start of the sentence in a future edit. Pol098 (talk) 12:59, 15 November 2013 (UTC)

There are two types of template parameter: named and positional. Named parameters are those with an equals sign, and comprise a name and a value; positional parameters are those without with an equals sign, and comprise a value alone. At present, |lc=y is a named parameter - the name is lc and the value is y. Omitting =y doesn't leave lc as a name without a value, it leaves it as a value without a name. If you try {{as of|2013|11|15|lc}} you'll see that the lc is ignored: As of 15 November 2013.
This template recognises three positional parameters - year, month and day. Of these, the latter two are optional. If we were to change the parameter signifying lowercase from a named parameter to a positional parameter, we would still need some means of distinguishing it from an omitted day (or month) in constructs like {{as of|2013|11|lc}}. I'm not saying it's not possible, but that it would complicate the template greatly for little gain. --Redrose64 (talk) 16:33, 15 November 2013 (UTC)
I see, sorry to waste your time with this. In principle it could be documented that "lc=n" is (I think) the same as "lc=y", but it hardly matters. As it happens, I've been using "lc=on" for years (presumably misremembered, tried something reasonable rather than read docs, worked, kept it; hope existing instances don't get invalidated at some future time). Will use "lc=y" or nothing in future. Thanks, Pol098 (talk) 21:27, 15 November 2013 (UTC)
Somebody changed the recommendation from "lc=on" to "lc=y".[1] It's not terribly important but consistent use makes it easier to read the code for people who don't know that any value works. PrimeHunter (talk) 22:41, 15 November 2013 (UTC)
Well |foo=y is pretty standard around here. It's very rare for any template documentation here to recommend a value of |foo=on, and even {{YesNo}} doesn't test for it, so we should probably discourage it. In the case of this and many other templates, it doesn't intrinsically matter what the value is (the scripted behavior will trigger if any value is present), but it can matter when other things test for an explicitly positive or negative value, and features to do so are often added to templates as later add-ons. Because of that factor, we want people to use a valid positive value (from {{YesNo}}'s perspective).  — SMcCandlish ¢ ≽ʌⱷ҅ʌ≼  23:37, 27 November 2015 (UTC)

Start date[edit]

This template wraps the date in {{start date}}, contrary to Template:Start date#Usage; partly because an "as of" date is not the date "that an event or entity started or was created"; and it is not always used "inside other templates ... which emit microformats". Instead I propose:

{{#ifeq:{{lc:{{{df|}}}}}|us|{{MONTHNAME|{{{2}}}}} {{#expr:{{{3}}}}},|{{#expr:{{{3}}}}} {{MONTHNAME|{{{2}}}}} {{{1}}}

Does anybody mind if I remove {{start date}}, replacing it with the above? --Redrose64 (talk) 23:11, 26 December 2013 (UTC)

It certainly should not do so; please go ahead ASAP. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 23:51, 26 December 2013 (UTC)
I agree that this template should not use {{Start date}}. Whether or not that is the correct code to replace it with I do not know, but if test have been run(!), then go ahead. Debresser (talk) 00:10, 27 December 2013 (UTC)
I set up some testcases. --Redrose64 (talk) 00:58, 29 December 2013 (UTC)
This appears to have been forgotten... The test cases look fine to me and there is agreement above, so if someone with appropriate rights could make the edit...? Thanks. – PartTimeGnome (talk | contribs) 15:14, 22 March 2014 (UTC)
Right, Done --Redrose64 (talk) 00:00, 23 March 2014 (UTC)
Face-smile.svg Thank you, Redrose64. – PartTimeGnome (talk | contribs) 00:11, 23 March 2014 (UTC)

Weird whitespace issue[edit]

I may have found a display bug with this template. Yesterday I made an edit to an article to correct some extra whitespace appearing immediately between the template and a punctuation mark. The output text was displaying "As of 2013 ," instead of "As of 2013," like it does when you look at the page in the history. Another editor noticed my edit and messaged me that the errant whitespace does not appear when you look at the old version of the page through the page history. I tried using the template again on my talk page and found that it is showing the whitepsace again for me there.

The problem appears when you type "{{As of|2013}}," and save the page, the output text looks like "As of 2013 ," with an extra space before the comma. Thanks! Slambo (Speak) 14:53, 7 January 2014 (UTC)

Looking at the source of User talk:Slambo, the extra space occurs after the </sup> - the only code in {{as of}} after this point is the {{DMCA}}, which leads me to look into that template. I suspect that the problem was probably caused by this edit made to {{Dated maintenance category}} by John of Reading (talk · contribs). --Redrose64 (talk) 16:18, 7 January 2014 (UTC)
Yes: Start{{DMCA|Articles containing potentially dated statements|from|2013|All articles containing potentially dated statements}}Stop → StartStop - note the space. --Redrose64 (talk) 16:24, 7 January 2014 (UTC)
(edit conflict) The discussion, now archived here, favoured adding an explicit space to the template, but adding a <nowiki /> was also mentioned. That wouldn't have this unhelpful side-effect. -- John of Reading (talk) 16:33, 7 January 2014 (UTC)
I've looked deeper into {{Dated maintenance category}} and it has a namespace test: the space, coded as &#21;, should only appear outside mainspace and also only when |onlyarticles=yesis set. This is because when used in mainspace, or when |onlyarticles=yes is not set, the categories occupy the position of that space. This explains why the space appears on this page and User talk:Slambo, but does not explain why Slambo was seeing it on the previous version of Stapleton Road railway station.
Looking at the code in relation to the archived VPT discussion, it's hard to understand what the space is intended to achieve. There was a perceived problem when {{use British English}} and {{use dmy dates}} were placed on separate lines at the top of an article; but these are only intended for use in mainspace - and since they use {{DMCA}}, this means that |onlyarticles=yes is set. Therefore, there ought to be categories here (e.g. Category:Use dmy dates from January 2014), and not a space. --Redrose64 (talk) 17:12, 7 January 2014 (UTC)
────────────────────────────────────────────────────────────────────────────────────────────────────@Slambo: Can you confirm that you were seeing the extra space in the article itself? I don't see the space when viewing the the old version; I only see it after copying the code to a sandbox or other page outside the main namespace.
The space was there when I made the edit, otherwise I would not have bothered with the edit in the first place. Slambo (Speak) 22:27, 7 January 2014 (UTC)
@Redrose64: The comment at the EngvarB deletion discussion mentioned white space at the top of Old revision of Pippa Passes . At that time, the top of the article looked like this...
{{EngvarB|date=September 2013}}
{{Use dmy dates|date=September 2013}}
{{italic title}}
{{for|the city of the same name|Pippa Passes, Kentucky}}
'''''Pippa Passes''''' is a dramatic piece...

Pasting that into Special:ExpandTemplates gets you...

[[Category:EngvarB from September 2013]]
[[Category:Use dmy dates from September 2013]]

<div class="dablink">For the city of the same name, see [[:Pippa Passes, Kentucky]].</div>
'''''Pippa Passes''''' is a dramatic piece...
...leading to white space. By experiment, one possible fix is to arrange for each of those Category statements to be preceded or followed by a <nowiki /> - by editing {{Dated maintenance category}} so that it always outputs a <nowiki />, even in mainspace. Another possible fix is to modify {{italic title}} so that it outputs a <nowiki />. -- John of Reading (talk) 18:42, 7 January 2014 (UTC)
I can confirm that both fixes work for this case. However, {{italic title}} runs into similar issues when used after various other things (e.g. after behaviour switches like __NOTOC__), so it would probably be best to add a <nowiki /> inside {{italic title}}. There's no harm to doing both, of course. – PartTimeGnome (talk | contribs) 21:27, 7 January 2014 (UTC)
Both then. :) We should get rid of this issue, now that we know the cause. But are you sure the problem of Italic title would be solved by that? Debresser (talk) 21:51, 7 January 2014 (UTC)
Yes. I put the code in a sandbox, then tested adding <nowiki /> in various places. I found it works at the end of {{Use dmy dates|...}}, and at the start or end of {{italic title}}. (I can't link to the sandbox because I didn't save it, but it's simple enough to make your own.) – PartTimeGnome (talk | contribs) 22:11, 7 January 2014 (UTC)
──────────────────────────────────────────────────────────────────────────────────────────────────── I've made an edit to {{Dated maintenance category}}, so {{As of}} definitely won't output unwanted spaces in any namespace. -- John of Reading (talk) 08:28, 8 January 2014 (UTC)

Unambiguous date format[edit]

I'm not experienced with coding templates, but I'd like to suggest changing the date format parameter so that the template accepts "df=dmy" and "df=mdy" as valid options, with self-explanatory results. I've been editing pages recently where someone has inserted a different country code into the template (eg. "df=CA") expecting to get proper results, but instead it just defaults to dmy format, which in a lot of cases is incorrect or inconsistent with the article. I would do it myself but I'm pretty sure I would mess it up. Ivanvector (talk) 20:19, 20 March 2014 (UTC)

Unfortunately the various templates which have a |df= parameter are inconsistent in both the meaning (for some, it means "day first"; for others, it means "date format") and the permitted values (should they be "yes"/"no", "dmy"/"mdy" or something else). In this case, it means "date format", and only one specific value is tested for: |df=us (case-insensitive) means to format the date as month-day-year - anything else, including blank or absent parameter, means day-month-year. This use of a country code is so unusual that I can't think of a similar case in any other template. --Redrose64 (talk) 21:14, 20 March 2014 (UTC)
I don't know which other templates use that parameter, but maybe it'd be a good idea to universally change it to something like "format=dmy" or something? I'm a big fan of consistency. Ivanvector (talk) 21:34, 20 March 2014 (UTC)
At the very least, use a #switch that accepts both "US" and "mdy" as meaning the same thing. "df=US" could then be deprecated in the documentation. This would be a good start towards consistently using "mdy". – PartTimeGnome (talk | contribs) 15:23, 22 March 2014 (UTC)

As of a decade?[edit]

Is there any way to use this tag for "as of the 1990s"? If not, how hard would that be to add? Maury Markowitz (talk) 13:52, 20 April 2014 (UTC)

Almost every time I use this template I'm trying to do something else… I don't want "as of 1990", I want "as of the 1990s".

This template appears to have many ways to make it more specific, month and day for instance, but no way to make it less specific, decade or century?

Maury Markowitz (talk) 15:35, 5 May 2014 (UTC)

You asked this two weeks ago. --Redrose64 (talk) 16:40, 5 May 2014 (UTC)

As of today[edit]

Could there be a parameter added so that if the date is today's, it displays as As of today? — Preceding unsigned comment added by Ollieinc (talkcontribs) 09:16, 7 May 2014‎

Why? After a maximum of 24 hours, it would no longer be necessary. --Redrose64 (talk) 09:40, 7 May 2014 (UTC)
It would be useful when used on things such as episode counts in infoboxes, so it is easy to tell at a glance the count has been updated to include the current day's episode. Ollieinc (talk) 10:17, 7 May 2014 (UTC)
I wouldn't trust "As of today" to actually be updated today. It could just as well be an editor who improperly spelled out "As of today" without using the template. We also have reusers who keep a fixed copy of articles without updating or specifying the date of the copy, so readers of such copies wouldn't know what "today" is. PrimeHunter (talk) 10:26, 7 May 2014 (UTC)
Ok, what about if it was made so it displayed like one of these? Ollieinc (talk) 04:57, 8 May 2014 (UTC)
As of 12 July 2014 (today)
As of 12 July 2014 (today)
As of 12 July 2014 (today)
That would be better but I'm still not happy about it in an encyclopedia. Pages are cached here so "today" would often be wrong until it's removed when the page is purged or rerendered for some reason. And when it's right it can still cause confusion for readers in other time zones than UTC. Editors usually know we use UTC but not readers. PrimeHunter (talk) 00:38, 9 May 2014 (UTC)
Ok, fair enough. Ollieinc (talk) 04:14, 9 May 2014 (UTC)

Namespace[edit]

As of today this template does not add pages in other (even) namespaces to a hidden maintenance category. I think it should do this in the project, portal, template, and file namespaces, with category:Pages containing potentially dated statements. –Be..anyone (talk) 21:47, 1 February 2015 (UTC)

Is there a way to display past or future dates relative to current?[edit]

In other words: Can you display a year that is always 17 years ago, so updates like this are no longer necessary? --RacerX11 Talk to meStalk me 00:02, 8 May 2015 (UTC)

Answered at Template talk:Time ago#Is there as way to input an interval + current date = displayed date? PrimeHunter (talk) 00:36, 8 May 2015 (UTC)

Doing away with three parameters[edit]

Why is this template stuck in the pre-#time parser age? Why not enter the full date as a single parameter? It would make the template a whole lot easier to use. Compare {{as of|2015|05|27}} and {{as of|27 May 2015}}, or worse {{as of|2015|05|27|df=us}} and {{as of|May 27, 2015}}. The code would be much easier to read, write and search in edit mode. Unnamed parameters {{{2}}} & {{{3}}} could be deprecated and eventually removed as could parameter {{{df}}}. Note that {{as of|27 May 2015}} and {{as of|May 27, 2015}} work anyway as far a what is shown on the page goes, so, one would be forgiven for thinking that this would be the way to use the template, I'm thinking that this should be the way to use the template. Jimp 17:55, 26 May 2015 (UTC)

Possibly; but the month and year are needed for categorisation, since if you put the whole date in one param, you get a redlinked category, compare this version with this edit. --Redrose64 (talk) 19:16, 26 May 2015 (UTC)
Maybe start this project with an error tracking category {{#iferror:{{#expr:0+{{{1|May 26, 2015}}}}}|<mark>oops</mark>}} for oops, extended by {{#time:M Y|{{{1|May 26, 2015}}}}} for May 2015 if there are enough simple errors to justify the effort. –Be..anyone (talk) 20:06, 26 May 2015 (UTC)

Template-protected edit request on 10 September 2015[edit]

Had a thought (and I'm not sure how exactly this could be implemented), but I was just trying to use this template on a page and I typed {{As of|September 10th}}, which of course is not valid... It worked but added the page the Category:Articles containing potentially dated statements from September 15th. (I should have done {{As of|2015|09|10|alt=As of September 10th}}). My thought was that in the event that you do use the template incorrectly in such a way that it attempts to add the page to a non-existent category, throw an {{Error}} that would say something like OMFG YOU USED THIS WRONG! No but seriously some sort of error message that directs you to check the format of the {{As of}} template? Anyone have any thoughts? I'd be happy to help mock this up in my sandbox. Zackmann08 (Talk to me/What I been doing) 16:53, 10 September 2015 (UTC)

Irrelevant, but you shouldn't be using ordinals in dates; see MOS:BADDATEFORMAT. Alakzi (talk) 17:05, 10 September 2015 (UTC)
I think it would be possible to actually allow input formats with the entire date given as one parameter, by checking if the first param is a valid year and using {{#time}} to separate the parts of the date if not.
The template already checks if the first param is a valid year, but it doesn't parse it unless it detects a year older than 2004. We could easily change
{{#if: {{#ifexpr: {{{1}}} = 1 }} | {{#ifexpr: {{#time:Y|{{{1}}}}} > 2004 | {{{1}}} | {{#ifexpr: {{#time:Y|{{{1}}}}} > 1989 | {{#time:Y|{{{1}}}}} | before 1990 }}}}
to
{{#if: {{#ifexpr: {{{1}}} = 1 }} | {{#ifexpr: {{#time:Y|{{{1}}}}} > 2004 | {{#time:F Y|{{{1}}}}} | {{#ifexpr: {{#time:Y|{{{1}}}}} > 1989 | {{#time:Y|{{{1}}}}} | before 1990 }}}}
, so that putting something like "September 10, 2015" (or even "September 10th") would still be parsed correctly. We could still add {{#iferror: {{#time:Y|{{{1}}}}} | {{error|Invalid input! See [[:Template:As of]] for more information.}} |}} to catch input strings that {{#time:}} can't parse. --Ahecht (TALK
PAGE
) 17:49, 10 September 2015 (UTC)
I mocked it up in the sandbox here. --Ahecht (TALK
PAGE
) 18:15, 10 September 2015 (UTC)
FYI, please don't use edit-protected templates unless you have a specific change that can be readily implemented. SiBr4 (talk) 17:17, 10 September 2015 (UTC)
@Alakzi: Irrelevant? Sure... But informative and useful? 100% yes! Thanks.
@SiBr4: That would be awesome and thank you for the note about not using the template. Was unaware of how to use it. Will remember that for the future.
Zackmann08 (Talk to me/What I been doing) 17:34, 10 September 2015 (UTC)

The ref / update link is not "hidden by default"[edit]

The source comments say that the ref or update "inline banner" link is "hidden by default" but this is not the case. Something seems to have changed that causes it to display by default, and this is not desirable. The usual use of this template is to indicate information that was correct at the time it was entered and expected to be correct unless something change, not until something changes. For "until" cases, this feature should be able to be turned on, with a parameter, but otherwise should not show, unless it's in "ref" not "update" mode due to the presence of a |url= value.  — SMcCandlish ¢ ≽ʌⱷ҅ʌ≼  23:32, 27 November 2015 (UTC)

It's hidden by default as it says. You see it because you requested it in your common.css last month.[2]. The code is at Wikipedia:As of#Article maintenance which is linked in the template documentation for the url parameter. PrimeHunter (talk) 01:03, 28 November 2015 (UTC)
Ah, OK (durr!). But I'm seeing "[update]" links when |url= is not specified, even when no update is needed yet, e.g. immediately after "the current issue as of 2016" at Jargon File. I can confirm that this is not appearing when I'm logged out, so it's not affecting readers. However, it just seems wasteful for the code to be generating then hiding these things if they are not actually needed at the time. It would be more useful if this actually did some kind of date checking so that those doing maintenance are only alerted to attempt any for these things when the date specified has passed. E.g. in that particular case, it shouldn't show up until the year becomes 2017.  — SMcCandlish ¢ ≽ʌⱷ҅ʌ≼  21:49, 5 January 2016 (UTC)

alt parameter[edit]

Yes check.svg Done

I would like to display 'as of week of January 4, 2016' instead of 'as of January 4, 2016' in some tennis-ranking related articles and templates, because those rankings are updated weekly (every Monday) by tennis federations. Setting 'alt=as of week of' does not work here, as the date will not be displayed. Would it be worth making another alt parameter that does not stop the date from being displayed? Thanks, Gap9551 (talk) 21:34, 4 January 2016 (UTC)

|alt=as of the week of January 4, 2016 would seem to work.  — SMcCandlish ¢ ≽ʌⱷ҅ʌ≼  21:52, 5 January 2016 (UTC)
@Gap9551: This was a trivial fix, and potentially useful for a number of applications, so I implemented this as |pre=the week of:
{{as of|pre=the appeal filed on|2016|01|05}} → As of the appeal filed on 5 January 2016
{{as of|lc=y|since=y|pre=their disappearance in|2016|01}} → since their disappearance in January 2016
 — SMcCandlish ¢ ≽ʌⱷ҅ʌ≼  22:10, 5 January 2016 (UTC)
Thanks a lot! Simply including the date in the 'alt' parameter was a clever hack, I wish I had thought of that! But the 'pre' parameter is even more elegant. Thanks for implementing, Gap9551 (talk) 00:45, 6 January 2016 (UTC)
It's "cleaner" too, in case we ever need to do some kind of metadata thing with the dates, like some future form of autoformatting that is not the linking-all-dates boondoggle the last version was.  — SMcCandlish ¢ ≽ʌⱷ҅ʌ≼  02:24, 28 January 2016 (UTC)

Can we have a post= parameter?[edit]

Yes check.svg Done

Can we get a "post" parameter, analogous to "pre"? I would use it primarily for including a comma (and less frequently, a period) prior to the bracketed signal.

Currently, an invocation like

{{as of|January 2016}}, the decision remains pending.

renders as

As of January 2016, the decision remains pending.

The position of the bracketed "update" tag would be better outside the comma, as WP:REFPUNC specifies for bracketed references. (I realize the update tag is not a reference, but the same stylistic issues apply.)

What I'd like to be able to do is specify

{{as of|January 2016|post=,}} the decision remains pending.

and get

As of January 2016, the decision remains pending.

I suspect there are other contexts where this could be helpful, too, but the comma and period are the ones that particularly bug me. TJRC (talk) 22:56, 13 January 2016 (UTC)

I just noticed that the pre= parameter is quite new, added earlier this month by User:SMcCandlish, so I'll just cravenly mention his user name here to get his attention. TJRC (talk) 01:42, 28 January 2016 (UTC)
@TJRC: Good catch. I'd meant to implement that right after |pre=, but got distracted by cats or chocolate or something.  — SMcCandlish ¢ ≽ʌⱷ҅ʌ≼  02:22, 28 January 2016 (UTC)

What weird spacing? What superscripted note?[edit]

@SMcCandlish: Please look into this. TIA.--Thnidu (talk) 01:29, 5 May 2016 (UTC)

Parameter post= is documented thus:

post - text (almost always punctuation) to insert between the date and the superscripted note. For example, {{as of|2016|08|26|post=,}} none were found gives "As of 26 August 2016, none were found", while {{as of|2016|08|26}}, none were found results in weird spacing of the comma: "As of 26 August 2016, none were found."

Reformatted for ease of comparison, and substituting today's date:


post - text (almost always punctuation) to insert between the date and the superscripted note. For example,
  • {{as of|2016|05|03|post=,}} none were found
    gives
    "As of 3 May 2016, none were found"
while
  • {{as of|2016|05|03}}, none were found
    results in weird spacing of the comma:
    "As of 3 May 2016, none were found"


What weird spacing? What superscripted note? The outputs are identical. — Or is this only supposed to make a difference when used with url=* by a user who's displaying the links? That really ought to be documented, 'cause it's hella confusing.

* url – optional; adds an inline external link (hidden by default) suggesting a webpage for future editors to check for updates to the statement; use the full URL with no spaces. See Wikipedia:As of for displaying links.

Please {{Ping}} me to discuss. --Thnidu (talk) 04:27, 3 May 2016 (UTC

The outputs aren't identical. Without post= it appears as "[update]," (comma "," follows the superscripted note "[update]"); with post= it appears as ",[update]" (comma "," precedes the superscripted note "[update]"). TJRC (talk) 01:41, 5 May 2016 (UTC)
  • What TJRC said. There's nothing to fix here, other than Thnidu or someone can tweak the documentation to be more explicit somehow, but no one else seems to have been confused about this so far.  — SMcCandlish ¢ ≽ʌⱷ҅ʌ≼  05:07, 5 May 2016 (UTC)
@SMcCandlish and TJRC: But the examples have no "[update]" at all on either side of the comma or elsewhere... at least not for me. I dare suspect, fellow editors, that you use this template and have some form of the .as-of... line in your CSS files, while I, who am trying to learn about the template, do not. And if that is the case, that's why this documentation is such a puzzle to n00bs like me while you see no problem.
I have tried to correct this problem in the doc, including explicitly mentioning both conditions required for the "weird spacing" to occur, and both describing and demonstrating the difference in sequence (not spacing) instead of just calling it "weird" (thank you, TJRC, for the wikicode for the output). Please look at the doc for the "post=" parameter now and tell me what you think. TIA. --Thnidu (talk) 07:47, 5 May 2016 (UTC)
You're probably right. I don't remember doing it, but it looks like I added a .asof-tag directive to my vector.css file a year or so ago. When I log out from wikipedia, I no longer see the "[update]" text.
I'm not smart enough on CSS to comment specifically on your edit. I no doubt copied the CSS directive from somewhere. TJRC (talk) 17:38, 5 May 2016 (UTC)
@TJRC: Thanks for confirming my hunch. -- I've used and written CSS code, but seldom if ever on WP; I got my info for this from WP: As of#Article maintenance. --Thnidu (talk) 17:51, 5 May 2016 (UTC)