Forum:Is it possible to have two buttons to switch between american and british dates, and feet/meters?

Would it be possible to add a button to the wiki interface that allows the user to switch between American and UK dates, aswell as a button to switch between English and Metric measurements? It would also be great if it saved a cookie, remembering your preferences? The wiki is rollercoaster.wikia.com. Thanks


 * Can someone help?


 * What exactly are you referring to? You can customise the date format in your Preferences to see it however you want for things like RecentChanges. There are no parts of the UI that use length measurements AFAIK. If you have dates in your articles, I suggest you look at ISO8601 (International Standard Date Format) which defines "2012-11-05 14:08:59" as the recommended way to write unambiguous dates for international consumption. If you have length/height measurements in your articles that you want to make convertable, that's very wiki specific and will require replacing all those measurements with a template then writing some JavaScript to switch/calculate between the two. Lunarity 02:14, November 5, 2012 (UTC


 * It's not the UI dates/measurements that I want to swap, rather the ones that are in our infoboxes. I would put it in a template (I knew that from the start), but what I need help on is the JavaScript (I know nothing about JS whatsoever).


 * Basically, I want it to behave like the top right on www.rcdb.com, or the "Preferences" page.

(Reset indent) If it's an infobox then you can just modify the infobox template to tag the height/width rows properly, that's relatively easy. If you just want a block of code to use, try this: You'll need to place the measurements in a  with the   class, like. Lunarity 01:43, November 6, 2012 (UTC)


 * I've added that to my wiki's Common.js page an tested the span you have me, but it doesn't seem to have done anything. What is the code actually ment to do? Is it supposed to display a button? —This (wall • contribs) . Please sign your posts with


 * Two things:
 * I coded it to only run on article pages. It won't work in any other namespace.
 * Your Common.js is broken. It doesn't work because the entire file is corrupt. Remove everything except the above the code. (None of the other stuff works anyway)
 * Lunarity 03:46, November 7, 2012 (UTC)


 * I've got it to work, but I don't know how to fix the following things:
 * The button is out-of-line with the Edit and Talk buttons.
 * Round to one decimal place, and remove excess 0's after the decimal
 * Also, would it be possible for you to make one that can convert "November 7, 2012" to "7 November 2012", when another button is pressed? Thanks alot for your time :)
 * I don't know if this is possible, but could you make it so that you can enter only numeric figures in (how are current infoboxes work), then depending on the span entered, it adds "feet" (not ft) to the end, and that will swap to "meters" when the button is clicked. Thanks again


 * I changed ft/m to feet/meters, it doesn't do foot/meter (one) though. I added dates but it will only do the exact format you showed me. Use . Rounding was a problem because the numerical errors due to the loss of precision would compound rapidly if you switched back and forth a few times, that's fixed. I switched to wikia-buttons instead of real buttons so it should line up properly now. The buttons will now only appear on pages that have convertables in them.


 * The code isn't written to operate unitless, there's no way to tell if a number is feet or meters without the unit unless you add an extra class to the span. If the word "feet" is added by the infobox, it shouldn't be hard to modify the infobox to place both the number and the "feet" inside of the span since they're both in the same table row (, replace "feet" with "meters" if the infobox takes meters instead). Making the unit only appear when the script runs is not a good idea since it'll render without units until the script runs, which can take a very noticeable several seconds on long pages. Also, the conversion won't work in [ wikiamobile] since you can't add code to that skin. Lunarity 08:12, November 8, 2012 (UTC)


 * I've got it to work now! Just one more thing: Can you add compatibility for mph to km/h? It works very well in the infobox, but mph measurements are being mistaken for feet.
 * Also, can you alter it to allow numbers with commas (eg: 5,000)? Thanks