User talk:Gary/Archives/2019
This is an archive of past discussions with User:Gary. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Comments in Local Time
Very odd. I was just reading the humor piece in today's Signpost (at WP:Wikipedia Signpost/2019-03-31/From the editors). I live in New Jersey, and the gadget converted the UTC times in the piece to ... "UTC‑4.933333333333334" (and no summer adjustment). I presume this has something to do with the reality of life in 1876, but I couldn't figure it out from the code. What's up with it? With admiration, StevenJ81 (talk) 15:20, 12 April 2019 (UTC)
- The relevant code is:
utcOffset = (-1 * time.getTimezoneOffset()) / 60;
utcOffset = utcOffset >= 0 ? '+' + utcOffset : '−' + Math.abs(utcOffset);
- So the timezone offset is retrieved from your browser. If it happens again, you can try checking the value of your browser's timezone offset with the following code in your JavaScript Console:
(new Date()).getTimezoneOffset()
Gary (talk · scripts) 18:30, 12 April 2019 (UTC)
- Didn't help, as on the current date, that correctly returns "240" (or UTC-4, EDT). (Ordinary posts work fine, both when I'm in UTC-4 and when I'm in UTC-5, and even when I've traveled a few times.)
- No, the year in which this behavior starts to take place (going backwards from now) is 1883, the year before the International Meridian Conference. So I'm guessing that by design or by accident you're calling something that doesn't recognize time zones before then ... and uses my meridian, somehow, to try to guess my time. (Since I'm actually west of 75degW, I'm not quite sure it works right.) StevenJ81 (talk) 19:38, 12 April 2019 (UTC)
- Can you point me to exactly which timestamp you are saying that this happens? I briefly skimmed the linked article but couldn't find a timestamp in it, let alone one that's in the 19th century. Or a screenshot of the problem would be even better. Thanks. Gary (talk · scripts) 20:07, 12 April 2019 (UTC)
- Okay I see what you are referring to now. You linked to a different page. This is the one you meant, I assume: Wikipedia:Wikipedia Signpost/2019-03-31/Humour. Gary (talk · scripts) 20:51, 12 April 2019 (UTC)
- I'll see what I can do with it, but it isn't really a high priority. It'll probably be a problem for timestamps that are before 1970 and after 2038, which happens very rarely. Gary (talk · scripts) 20:57, 12 April 2019 (UTC)
- @StevenJ81: I've re-written the script and fixed the original bug you mentioned. Please check it, and let me know if you find any other bugs, since new ones may have appeared since the major overhaul I just made. Gary (talk · scripts) 02:34, 13 April 2019 (UTC)
- Thanks. The time zone stuff seems to be working now. It seems to handle DST correctly from 1918 on, and suppresses it before then. Pre-1884, it's assuming I'm at UTC-4.9; assuming that's a rounded version of -4.993, it's assuming I'm in New York, because my time zone setting is
America/New York
, and New York is at 44°W (whose mean solar time zone would be "UTC"-4.993). - The date interval calculations aren't right, the farther back in time you go. Picking the same date—say, September 10—should always give the same number of "months" and "days" ago, with only years changing. But that's not actually the case. Question is how much you want to fiddle with this; I'd understand if it's not your biggest priority now. StevenJ81 (talk) 20:14, 15 April 2019 (UTC)
- Thanks. The time zone stuff seems to be working now. It seems to handle DST correctly from 1918 on, and suppresses it before then. Pre-1884, it's assuming I'm at UTC-4.9; assuming that's a rounded version of -4.993, it's assuming I'm in New York, because my time zone setting is
- Yeah the date calculations are not completely accurate. It can be improved. But it would take time. I may do it later. Gary (talk · scripts) 21:47, 15 April 2019 (UTC)
Doesn't work in modern or cologneblue
I was away for a bit and noticed this stopped working. I think it's related to the changing use of bodyContent
; both the modern and cologneblue skins don't use #bodyContent
. I think mw_contentholder
is roughly the parallel for modern and article
is for cologneblue, but I think mw-content-text
can fill in for everything if tweaked. ~ Amory (u • t • c) 17:39, 15 April 2019 (UTC)
- I'll use
.mw-parser-output
, which should work well. Gary (talk · scripts) 18:58, 15 April 2019 (UTC)- Looks great, thanks for the prompt fix! ~ Amory (u • t • c) 19:34, 15 April 2019 (UTC)
Comments in local time
Hello, Gary! :)
I'm the only interface administrator in the Albanian Wikiquote and Wikipedia and I'm continuously on the look out for new gadgets to bring to our communities. Your script about comments in local time seems like a good gadget I'd like to implement to the whole projects. As I'm still new at the interface administration, can you help me by telling how can I do that? What exactly do I need to add at the Common.js page? Also, can you explain what exactly does the script do? I get that it calculates how much time has passed from the moment the comment was made until the current time (this was the reason I liked the gadget and wanted to implement it for the whole projects). Does it do anything more than that? I'm a bit confused about the whole "local time" thing. Do we still need to set the time zone at the Preferences? - Klein Muçi (talk) 19:10, 22 June 2019 (UTC)
- Regarding how to setup a new gadget, you'll have to ask someone else for that, since I'm not an administrator here, so don't know how to do it. This script takes the timestamp that normally exists in signatures, which are in the UTC timezone, and converts it to a relative date, in the user's local timezone (based on their computer's settings, not their Wikipedia settings). Adapting the script to another Wikipedia will be difficult; you should find a programmer to do it for you, preferably someone that speaks your local language. This is because the script needs to be told the format of the timestamps in your local Wikipedia, so it knows what to look for and replace. This can be found in the code, in the regular expression after
document.querySelector('.mw-parser-output')
. Then the script can be localized in theLOCALIZING THIS SCRIPT
section. Gary (talk · scripts) 20:13, 22 June 2019 (UTC)- I see. I tried copy-pasting the code and translating the "localizing this script" part but it didn't work. Even as a normal gadget like it does in EnWiki. Unfortunately I didn't know how to tell the script the format of timestamps used in our projects so I guess I'll leave it until I find someone who can help (if I can). Thank you for clarifying things up for me! :) - Klein Muçi (talk) 01:25, 23 June 2019 (UTC)
Precious anniversary
Six years! |
---|
--Gerda Arendt (talk) 08:12, 2 March 2019 (UTC)
... and ten years awesome today! --Gerda Arendt (talk) 20:54, 14 March 2019 (UTC)
... and ten years awesome once more! --Gerda Arendt (talk) 09:12, 27 June 2019 (UTC)
ArbCom 2019 election voter message
Hi. I've opened a GAR on the The Killers article for which you are a main contributor. I have concerns that it does not quite meet current GA criteria regarding sourcing and other issues. Following the guidelines at Wikipedia:Good article reassessment, I'm letting you know in case you're interested in helping to resolve the concerns, though you are under no obligation to do anything. See Talk:The Killers/GA1 for more details. SilkTork (talk) 05:09, 23 November 2019 (UTC)