Template talk:Year in other calendars

From Wikipedia, the free encyclopedia

Contents

[edit] Islamic calendar

I really like this template, but there is a problem with the Islamic Calendar. An Islamic year is eleven days shorter than a Gregorian year, this is not accounted for, so many of the years are wrong. There is a similar problem with the Hebrew Calendar. Philip Stevens 16:25, 18 May 2006 (UTC)

Do you know of a formula which could be used to convert accurately? I have been unable to find one. Warofdreams talk 00:21, 19 May 2006 (UTC)
  • The formula for the Islamic Calendar is, year + ((year - 622)/32) - 622 Philip Stevens 06:04, 19 May 2006 (UTC)

[edit] Separating Hindu calendars.

To prevent:

Hindu calendars
- Vikram Samvat  2295 – 
- Shaka Samvat   2296
- Kali Yuga      2162 – 
                 2163
                 5341 – 
                 5342

can the 3 calendars please be put in seperate rows? -- Jeandré, 2006-06-03t21:48z

[edit] Future Japanese dates

Please help resolve the issue related to this template raised in Talk:Heisei#Future Japanese dates. `'mikka (t) 15:26, 28 June 2006 (UTC)

[edit] Ethiopian Calendar

I want to include the Ethiopian calendar on here, but I don't think I know enough Wikicode to do it. It's usually 8 years behind the Gregorian (7 from September 11th-December 31st) and has 365 days (+1 on leap years), but I think the new year date has changed by 1 day every 200 years, so I'm not sure exactly how to implement it. Can anyone help me out? I'm willing to better explain the relation between the two. — ዮም (Yom) | contribsTalkE 04:58, 9 July 2006 (UTC)

  • I have added the calendar but I'm not sure how well it will work beyond 2200CE. Philip Stevens 07:07, 9 July 2006 (UTC)

[edit] What happened to Japanese calendar

The Japanese seems to be gone. Why? --Apoc2400 14:23, 16 October 2006 (UTC)

I noticed that it was just removed, so I put it back again. Warofdreams: Talk about it her if there is a problem --Apoc2400 14:32, 16 October 2006 (UTC)
As you will be able to see if you look at almost any year, the Japanese calendar is not working; it displays "unknown", which is clearly untrue for most years. I'm no expert on the Japanese calendar, so to avoid having inaccurate information on 2000 pages, I removed it. Warofdreams talk 15:26, 16 October 2006 (UTC)
I have found a solution. When I edited 1700 I noticed {{Year in other calendars|japanese=[[Kansei]] 1 – 2}}. To override "unknown", just type a code like what I type here. Eventually, Japanese calendar should be back.--Jusjih 14:31, 19 October 2006 (UTC)

[edit] Chinese calendar

Like Japanese calendar, I consider that Chinese era names should be eventually included, but with thousands of years, it will be a major work. I plan to add with Japanese era names together.--Jusjih 14:32, 19 October 2006 (UTC)

[edit] Gregorian and Julian calendars

We should consider adding the Julian calendar supporting add-on information such as "common year starting on Friday". I consider that the Gregorian calendar should also support add-on information such as "common year starting on Friday" and for years before 1582, we should automate something like "nowhere used" to be more historically accurate.--Jusjih 14:33, 19 October 2006 (UTC)

[edit] Thai Calendar

Would it be possible to add the Thai solar calendar to this list? I'd add it myself, but I am unfamiliar with the coding and don't want to muck it up. It's simple, it's +543 years from the western year (2007 is 2550).

-Ashoka

[edit] Something has happened

Something very strange has happened to this template. It doesn't work properly on the year pages anymore, after todays edits. Can someone, who has knowledge of how it works, look into it and fix it? /Ludde23 Talk Contrib 13:23, 29 November 2006 (UTC)

  • Which calendars on which years have a problem? Philip Stevens 14:48, 29 November 2006 (UTC)
Look at any year, like 476 for instance. This template is used there (as well as on hundreds of other pages) and it does not work. I'm now reverting today's changes, so that it will work again. /Ludde23 Talk Contrib 18:17, 29 November 2006 (UTC)

[edit] Japanese calendar is back

After some work by User:Akanemoto and myself, the Japanese calendar section is close to being back. Akanemoto's version was not working completely, so I did some hacking to make it work (although I ran into really weird issues that led me to roll it back temporarily). In particular, his version wasn't supporting the explicit {{{year}}} parameter (only the implicit {{PAGENAME}}) and the era year for transitional years was showing the previous year's value instead of what it would have been if the emperor had not changed.

The Japanese support depends on the following templates:

  • {{Nengo}}: Determines the Japanese era name (nengō) given the Gregorian year
  • {{Japanese era}}: Returns the "base" date or kanji for a particular Japanese era name
  • {{Japanese year number}}: Returns the year number within the appropriate Japanese era, given the Gregorian year
  • {{Japanese year}}: Returns the era name and year within the era, given the Gregorian year (treating the entire year for a new emperor as "Era 1")

For any years that {{Nengo}} and {{Japanese era}} are not programmed to know the correct era and year, the first line will be blank, but the "Imperial Year" and "Jōmon Era" are still shown because they are simple calculations. Currently, this means that years before the Joo (second) era are not supported and will show up blank. This can be fixed by updating {{Nengo}} and {{Japanese era}} and this template will automatically pick it up.

When this was working, I tested it with the following years, expecting the output listed below:

This was all working before my attempt to suppress the previous era for transitional years where the previous era is not supported by {{Nengo}}. Once I tried that, the template broke horrendously and then rolling back to versions that had been working didn't work either, so I've removed the Japanese support for the time being. But given that I was able to get everything else working before that, I think it should be fairly simple to figure out what the problem was.

I've invited User:Akanemoto here to discuss. Mike Dillon 18:13, 10 December 2006 (UTC)

I'm pretty sure the behavior I was seeing was caused by some sort of bug (or at least behavior I don't yet understand). Compare these two revisions of Template talk:Japanese year: original, modified. In the original version, the Japanese year for 2006 (Heisei 18) showed up correctly. When I added a call to {{Japanese year|476}} above it, it broke. I can't see how anything but a bug would cause this. If the call to {{Japanese year|476}} is added after the call to {{Japanese year|2006}} (revision), it works. It looks like there is some sort of "state leak" problem that causes certain ParserFunction calls to be messed up if anything weird happens in an earlier call. Mike Dillon 19:12, 10 December 2006 (UTC)

I have made an inquiry about this issue at m:Talk:ParserFunctions#Possible bug in ParserFunctions version on en.wikipedia.org. Mike Dillon 19:25, 10 December 2006 (UTC)

As you may have noticed, User:Patrick and I were able to restore the Japanese calendar functionality to this template. Most of the fix was User:Patrick's changes to Template:Nengo, but I also introduced a Template:Year in other calendars/Japanese subtemplate to reduce the calls to Template:Nengo itself to 2 calls.
It turns out that the behavior I was seeing is not exactly a "bug", but more of a limitation on call counts for the parser functions. To further reduce the number of calls, I tried out a subtemplate technique for the Chinese calendar portion of this template at User:Mike Dillon/Year in other calendars, in addition to the complexity reducing technique I mentioned in the Complexity comment below. The Chinese subtemplate allows the calls to {{JD}} to be reduced to two calls and the use of User:Mike Dillon/Year in other calendars/internal allows the main template to be the only place that deals with the {{{year}}}/{{CURRENTYEAR}}/{{PAGENAME}} alternation. The internal template only cares about {{{year}}}, which makes it much easier to read and more maintainable.
The combination of User:Patrick's changes and mine means that this template will work on all expected changes within the era range supported by {{Nengo}} and {{Japanese era}} (1652-present). Hopefully the number of parser function calls is few enough that we can start adding support for at least some of the older eras from Japanese era name. If not, it may actually be necessary to introduce the subtemplate for the Chinese section to reduce the {{JD}} calls to the point where the Japanese template can do more work before hitting the limit.
There is a demo of my modified version of this template at User:Mike Dillon/Sandbox2. Mike Dillon 06:54, 12 December 2006 (UTC)

[edit] Complexity

I think most of the complexity of this template is coming from the attempt to default to {{PAGENAME}}. I'm thinking that this thing should be split into a piece that requires the year to be specified explicitly and a separate piece that calls the former and defaults "year" to <noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>. The pages that currently use this template would use that latter. That way, each of the individual calendar rows would only need to deal with {{{year}}}. Mike Dillon 18:18, 10 December 2006 (UTC)

An alternative would be to change all of the current template calls to use year={{subst:PAGENAME}}, which makes sense for me. I don't see why it should be defaulting to the page name anyways since these template calls don't need to be changed once they are set up on the individual year pages. Mike Dillon 18:27, 10 December 2006 (UTC)