Added plugin for converting non-Gregorian years #150

Merged
merged 2 commits into from May 3, 2013

Projects

None yet

2 participants

Owner
tagawa commented Jan 26, 2013

No description provided.

Member

Hi again!

This goodie looks cool. I don't know too much (anything) about the topic though, so I was hoping you could explain a bit more to me. I found this page which has a whole bunch of these eras, including I think, all of those in the goodie (some differ by a year or so). I have no idea of the validity of that document though.

Other than that, I was wondering if we could support more than just years. If the conversion is as simple as a constant difference in years, it shouldn't be too bad to parse out the rest of a date and add it to the result.

Finally, I'd like to add a bit more to the output. Usually for 'conversion' type goodies, we'd say something like 'Heisei 25 is equivalent to 2013 in the Gregorian Calendar'. It'd also be nice to add links to wikipedia or other pages that explain a bit more about each.

Let me know what you think of these ideas!
Thanks for writing these goodies, we really appreciate it :-)

Owner
tagawa commented Jan 27, 2013

You're welcome. I mostly do front-end work so it's interesting to mess around with Perl.

For the Japanese dates, they're sometimes used more than Gregorian dates especially in rural areas of Japan. E.g. on a form you'd fill in your date of birth as Showa XX rather than 19XX. The eras refer to the reign of a particular emperor so when the current emperor, er, moves on, the era will change from Heisei to something else. In everyday life, these dates are really only used from 1868, when Japan entered its modern era (following its equivalent of the French Revolution).
I know less about the North Korean and Taiwanese calendars, but they're both continuous starting from 1912.

This goodie would mostly be relevant for East Asian users so having unicode characters as the triggers (e.g. 昭和 for showa) would be ideal, but I wanted to get it working with ascii first.

I like the idea of converting whole dates (yes, the years are constant differences) and adding further explanation/links so I'll work on that next.
By the way, the page you linked to has the correct years. The years in my code are one less than the start years for calculation purposes, e.g. n + start year = actual year.

@majuscule majuscule merged commit 1fffff5 into duckduckgo:master May 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment