Category talk:Time, date and calendar templates

Clean up
There's a lot of unused or hardly used templates here. Many templates have complicated code which could be replaced with much simpler code based on the #time parser function. J IM ptalk·cont 08:33, 5 June 2012 (UTC)

ISO date templates
There used to be a tangle of ISO date templates one calling another until you hit one of the final ones with its huge algorithm. Using the #time parser function instead gives us a huge saving of code. Were they worth fixing? Note that accepts ISO week date format input (as a single parameter) & could easily enough be adjusted to output it too but there's hardly any use for this as was evident by the almost complete disuse of these. They had been used to form the basis of but that was rewritten using the #time parser function. After that rewrite there were very few instances where they were usefully employed. All of these uses have now been replaced with #time parser functions.

gave the current date in ISO week date format. The following could be used instead.

gave the current date in ISO format. The following could be used instead.

gave the current week in ISO week date format. The following could be used instead.

gave the current weekday number in ISO week date format. The following could be used instead.

converted a from a year, month and day to ISO week date format. The year, month and day were entered separately and defaulted to their current values. The following would be equivalent.

However, by entering the whole date as a single parameter we can make it easier to use (since there is only one parameter and also it doesn't have to be in YYYY-MM-DD format) and at the same time simplify the code.

gave an ISO week date year for a given year, month and day. The year, month and day were required and entered separately. The following would be equivalent.

Instead why not have a single-optional-parameter defaulting to the current time?

gave an ISO week date week for a given year, month and day. The year, month and day were required and entered separately. The following would be equivalent (except that you'd get a different error message for incorrect input & it accepts the month as a name or abbreviation).

Instead why not have a single-optional-parameter defaulting to the current time again?

gave an ISO week day number for a given year, month and day. The year was required but the day and month defaulted to the first and January. The following would be equivalent (except that you'd get a different error message for incorrect input & it accepts the month as a name or abbreviation).

Again a single-optional-parameter defaulting to the current time might be better.

produced a date in ISO YYYY-MM-DD format for a given ISO-week-date year, week (a single digit was accepted) and weekday number which were each required and entered separately. You'd get the same from the following (assuming correct input).

Again a single-optional-parameter version accepting the date in any format would be better.

produced a date of the month (with a leading zero if less than 10) for a given ISO-week-date year, week (a single digit was accepted) and weekday number which were each required and entered separately. You'd get the same from the following (assuming correct input).

Here's the single-optional-parameter version accepting the date in any format.

produced a month number (with a leading zero if less then 10) for a given ISO-week-date year, week (a single digit was accepted) and weekday number which were each required and entered separately. You'd get the same from the following (assuming correct input).

Here's the single-optional-parameter version accepting the date in any format.

produced a year for a given ISO-week-date year, week (a single digit was accepted) and weekday number which were each required and entered separately. You'd get the same from the following (assuming correct input).

Here's the single-optional-parameter version accepting the date in any format.

gave the same as.

gave the same as but without any leading zero. You'd get the same from the following (assuming correct input).

Here's the single-optional-parameter version accepting the date in any format.

gave the same as but without any leading zero. You'd get the same from the following (assuming correct input).

Here's the single-optional-parameter version accepting the date in any format.

A particularly strange example was. The doc pages consisted of "Please explain what this template does and how it can be used" in bold at the top and then a bunch of examples. There was no real explanation of what it's for. It was used about four or five times on WP where it did nothing but hide the month/day of dates in ISO format. J IM ptalk·cont 08:33, 5 June 2012 (UTC)

Here's an interesting template. It calculated the number of days left in the month (including today). You had to tell it how many days there were in the month, though. Interestingly there was a suggestion put on the page to use CURRENTMONTHDAYS instead of  (why not actually do so?). If this suggestion had been implimented, then the template wouldn't have had to be adjusted each month. The main contributor to the template overcame the problem with instead in the only transclusion the template enjoyed outside of its own talk pages (pages this was actually originally two templates: and  for months of 30 and 31 days respectively). Either way you get the number of days left in the current month (including today) which is what will give you. J IM ptalk·cont 08:33, 5 June 2012 (UTC)

This one was transcluded only on itself. It took three unnamed parameters the year, the month and the day of the week (as a number 0 for Sunday, 1 for Monday, etc.).

It would be better to reverse the order: day of the week, month then year so that you could leave out the year and default to the current year or leave out the year and month and default to the current year and month. The template called two other templates but it could use #time instead. By using #time you could combine the year and month into one parameter (you could combine all three into one but that would not be that logical). You can also make it more user-friendly by allowing the day to be entered as a word or abbreviation instead of a number. This could be used instead (the first parameter is the weekday and the second the month/year):

... if ever we need to know the number of a given weekday there is in a month. J IM ptalk·cont 09:24, 5 June 2012 (UTC)