Content deleted Content added
Anomalocaris (talk | contribs) m <font> → <span style> |
|||
(56 intermediate revisions by 9 users not shown) | |||
Line 97:
:I added {{tag|syntaxhighlight}} to make your code more readable. How does this change make {{tlx|Infobox time zone}} {{tq|work more reliably}}? If that template is 'unreliable', shouldn't fixes be applied there? Why is your proposed code so complex? Can't it be made simpler?
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 16:04, 8 August 2018 (UTC)
::Wouldn't this work just as well?
{{collapse top}} <syntaxhighlight lang=Lua style="margin-left:4.8em">function p.offset (frame)
local args = getArgs(frame);
Line 263 ⟶ 264:
:*<code><nowiki>{{#invoke:time/sandbox|time|dateonly=yes|df=iso}}</nowiki></code> → {{#invoke:time/sandbox|time|dateonly=yes|df=iso}}
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 21:13, 9 August 2018 (UTC)
::{{ping|Trappist the monk}} Fixed the issues from above:
{{collapse top}} <syntaxhighlight lang=Lua>
function p.time (frame)
Line 472 ⟶ 474:
['sst'] = {
abbr = 'SST',
dst_abbr = '<nowiki/>',
utc_offset = '08:00',
df = 'dmy',
dst_begins = '<nowiki/>',
dst_ends = '<nowiki/>',
dst_time = '<nowiki/>',
article = 'Time in Singapore' [[User:Fiipchip|Fiipchip]] ([[User talk:Fiipchip|talk]]) 09:56, 15 August 2018 (UTC)
:{{done}}
Line 483 ⟶ 485:
== Template-protected edit request on 3 September 2018 ==
{{Archive top}}
{{edit template-protected|Module:Time|answered=yes}}
I've made some edits to the sandbox ([https://en.wikipedia.org/w/index.php?title=Special:ComparePages&page1=Module:Time&page2=Module:Time/sandbox&diffmode=source diff]) and data/sandbox ([https://en.wikipedia.org/w/index.php?title=Special:ComparePages&page1=Module:Time/data&page2=Module:Time/data/sandbox&diffmode=source diff]). These edits add support for DST timezone such as EST and other names that timezone are known as (the list is small right now) such as ET. It also adds more support for UTC offsets so +5, -5 ,+05, -05:30, -5.5 all work with it. A test page can be seen at [[User:BrandonXLF/sandbox/5]]. – [[User:BrandonXLF|<span style="color:#0011ff;font-family:Georgia;text-shadow: 0.15em 0.15em 0.15em #db3a00;'>'''BrandonXLF'''</span>]] [[User talk:BrandonXLF|<span style="color:blue;"><sup>'''(t@lk)'''</sup></span>]] 02:33, 3 September 2018 (UTC)
Line 509 ⟶ 511:
:::::::::I can imagine supporting dst timezone abbreviations as aliases of standard timezone abbreviations (as long as the dst abbreviation doesn't conflict with an existing standard timezone abbreviation) which would cause the template's output to be rendered exactly the same for regardless of which abbreviation (dst or standard) is used.
:::::::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 13:12, 6 September 2018 (UTC)
:::::::::Ok, sure I'll make then aliases instead of how they are. – [[User:BrandonXLF|<span style="color:#0011ff;font-family:Georgia;text-shadow: 0.15em 0.15em 0.15em #db3a00;'>'''BrandonXLF'''</span>]] [[User talk:BrandonXLF|<span style="color:blue;"><sup>'''(t@lk)'''</sup></span>]] 20:22, 6 September 2018 (UTC)
{{outdent|:::::::::}}
{{ping|User:Trappist the monk}} I made the DST offset aliases, I added more aliases, I made it so you can set dst=always for it to always be DST (takes very little code) and I removed all code that you said needed to be removed? Is it good now, I'm always happy to add suggestions. I also added HST as a seprate timezone as per [[#Abbreviations for Hawaii-Aleutian time zones are wrong]] and my own research. – [[User:BrandonXLF|<span style="color:#0011ff;font-family:Georgia;text-shadow: 0.15em 0.15em 0.15em #db3a00;'>'''BrandonXLF'''</span>]] [[User talk:BrandonXLF|<span style="color:blue;"><sup>'''(t@lk)'''</sup></span>]] 20:32, 7 September 2018 (UTC)
*As a lot has changed I made a new request – [[User:BrandonXLF|<span style="color:#0011ff;font-family:Georgia;text-shadow: 0.15em 0.15em 0.15em #db3a00;'>'''BrandonXLF'''</span>]] [[User talk:BrandonXLF|<span style="color:blue;"><sup>'''(t@lk)'''</sup></span>]] 01:02, 9 September 2018 (UTC)
{{Archive bottom}}
== Template-protected edit request on 9 September 2018 ==
{{edit template-protected|Module:Time|answered=y}}
({{ping|User:Trappist the monk}}) A update to [[#Template-protected edit request on 3 September 2018]], Replace the contents of [[Module:time]] with [[Module:time/sandbox]] ([https://en.wikipedia.org/w/index.php?title=Special:ComparePages&page1=Module:Time&page2=Module:Time/sandbox&diffmode=source diff]) and the contents of [[Module:time/data]] with [[Module:time/data/sandbox]] ([https://en.wikipedia.org/w/index.php?title=Special:ComparePages&page1=Module:Time/data&page2=Module:Time/data/sandbox&diffmode=source diff]). Examples of usage can be seen at [[User:BrandonXLF/sandbox/5]]. These edits add:<br />'''1)''' Aliases, extra abbreviations of timezones that allow for previous abbreviations that returned unknown to now return a timezone (including DST timezones)<br />'''2)''' More UTC offset support, allows for more support for UTC offsets (such as -5, +5 , +8:30 and -9.5 '''NEW''': +6.4)<br />'''3)''' DOW, adds dow as a format in the format table ('''NEW''')<br />'''Note:''' This edit also addresses [[#Abbreviations for Hawaii-Aleutian time zones are wrong]] – [[User:BrandonXLF|<span style="color:#0011ff;font-family:Georgia;text-shadow: 0.15em 0.15em 0.15em #db3a00;'>'''BrandonXLF'''</span>]] [[User talk:BrandonXLF|<span style="color:blue;"><sup>'''(t@lk)'''</sup></span>]] 00:56, 11 September 2018 (UTC)
:In the previous discussion I did write: {{tq|I might be persuaded that there is some sense in loosening the requirements for utc offset provided, however, that you do a better job with the code which is clearly not ready.}} You ignored that comment. For example:
::<code><nowiki>{{time/sandbox|1.2}}</nowiki></code> → {{time/sandbox|1.2}}
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 01:13, 9 September 2018 (UTC)
::{{ping|User:Trappist the monk}} I didn't even see part, my bad. I'll let you know when I do that, – [[User:BrandonXLF|<span style="color:#0011ff;font-family:Georgia;text-shadow: 0.15em 0.15em 0.15em #db3a00;'>'''BrandonXLF'''</span>]] [[User talk:BrandonXLF|<span style="color:blue;"><sup>'''(t@lk)'''</sup></span>]] 15:02, 9 September 2018 (UTC)
::{{ping|User:Trappist the monk}} I fixed the code and made it simpler, any more suggestions? – [[User:BrandonXLF|<span style="color:#0011ff;font-family:Georgia;text-shadow: 0.15em 0.15em 0.15em #db3a00;'>'''BrandonXLF'''</span>]] [[User talk:BrandonXLF|<span style="color:blue;"><sup>'''(t@lk)'''</sup></span>]] 18:57, 9 September 2018 (UTC)
:::Perhaps not:
::::<code><nowiki>{{time/sandbox|1.26}}</nowiki></code> → {{time/sandbox|1.26}}
:::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 19:29, 9 September 2018 (UTC)
::::{{ping|User:Trappist the monk}}The reason that doesn't work is because 1.26 = UTC+01:15.6 and you can't have a UTC offset of 1:15.6, if you'd like I can add a rounding function. So UTC1:15.6 ---> UTC1:16. Please let me know if I should add it. – [[User:BrandonXLF|<span style="color:#0011ff;font-family:Georgia;text-shadow: 0.15em 0.15em 0.15em #db3a00;'>'''BrandonXLF'''</span>]] [[User talk:BrandonXLF|<span style="color:blue;"><sup>'''(t@lk)'''</sup></span>]] 19:41, 9 September 2018 (UTC)
:::::The module should gracefully accept whatever it is given as input. The big red lua script error message is not graceful. So if I type:
::::::<code><nowiki>{{time|bob}}</nowiki></code>
:::::where there is not timezone called 'bob', the module should gracefully fail:
::::::{{time|bob}}
:::::and it does but the sandbox doesn't:
::::::<code><nowiki>{{time/sandbox|bob}}</nowiki></code> → {{time/sandbox|bob}}
:::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 19:54, 9 September 2018 (UTC)
::::::{{ping|User:Trappist the monk}} I added an error code, is it good now? – [[User:BrandonXLF|<span style="color:#0011ff;font-family:Georgia;text-shadow: 0.15em 0.15em 0.15em #db3a00;'>'''BrandonXLF'''</span>]] [[User talk:BrandonXLF|<span style="color:blue;"><sup>'''(t@lk)'''</sup></span>]] 20:02, 9 September 2018 (UTC)
:::::::{{ping|User:Trappist the monk}} I got the error code working for <code><nowiki>{{time/sandbox|bob}}</nowiki></code> too, it looks like {{time/sandbox|bob}}. Please let me know if you have any other suggestions. – [[User:BrandonXLF|<span style="color:#0011ff;font-family:Georgia;text-shadow: 0.15em 0.15em 0.15em #db3a00;'>'''BrandonXLF'''</span>]] [[User talk:BrandonXLF|<span style="color:blue;"><sup>'''(t@lk)'''</sup></span>]] 00:15, 10 September 2018 (UTC)
::::::::{{ping|User:Trappist the monk}} I made some monior fixes such as producing better error codes and accepting more logical inputs. I also added dow to the date format table, I think it could be useful. As far as this edit request goes I'm done unless you have any issues/suggestion about it
:::::::::I have rewritten <code>get_full_utc_offset()</code> so that it is simpler and easier to understand. I removed the format specification because the default time display format is handled elsewhere. I do not think that it should be changed from its current iso format; {{para|df}} is there for those who wish a different format. Fractional hours to two digits are more-or-less properly supported by truncation:
::::::::::<code><nowiki>{{time/sandbox|-6.17}}</nowiki></code> → {{time/sandbox|-6.17}}
:::::::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 12:05, 11 September 2018 (UTC)
::::::::::{{ping|User:Trappist the monk}} Everything looks fine, I'm done editing it. – [[User:BrandonXLF|<span style="color:#0011ff;font-family:Georgia;text-shadow: 0.15em 0.15em 0.15em #db3a00;'>'''BrandonXLF'''</span>]] [[User talk:BrandonXLF|<span style="color:blue;"><sup>'''(t@lk)'''</sup></span>]] 12:47, 11 September 2018 (UTC)
:::::::::::{{ping|User:Trappist the monk}} Is everything fine with the proposed edits? Any more questions about the proposed edits? I'm always happy to answer them. – [[User:BrandonXLF|<span style="color:#0011ff;font-family:Georgia;text-shadow: 0.15em 0.15em 0.15em #db3a00;'>'''BrandonXLF'''</span>]] [[User talk:BrandonXLF|<span style="color:blue;"><sup>'''(t@lk)'''</sup></span>]] 00:51, 13 September 2018 (UTC)
:[[File:Red information icon with gradient background.svg|20px|link=|alt=]] '''Not done:''' please make your requested changes to the module's sandbox first; see [[Wikipedia:Template sandbox and test cases|WP:TESTCASES]].<!-- Template:ETp --> [[Module:Time/testcases]] is empty and the tests in your sandbox show only the results from the sandbox, not a comparison of live & sandbox showing what your edits fix. You've used the tper template often enough to know which pages the tools link to, and where things ought to be. [[User:Cabayi|Cabayi]] ([[User talk:Cabayi|talk]]) 21:06, 23 September 2018 (UTC){{od|0}} {{Done}} as [[User:Trappist the monk]] implemented the changes in the sandbox. – [[User:BrandonXLF|<span style="color:#0011ff;font-family:Georgia;text-shadow: 0.15em 0.15em 0.15em #db3a00;'>'''BrandonXLF'''</span>]] [[User talk:BrandonXLF|<span style="color:blue;"><sup>'''(t@lk)'''</sup></span>]] 16:40, 5 October 2018 (UTC)
== why {timestamp}? ==
@[[User:Tom.Reding|Tom.Reding]]: Why {{tlx|time|_TEST_TIME_{{=}}{{tlx|timestamp}}}}? That gives the same results as {{tlx|time}} without parameters:
:<code><nowiki>{{time|_TEST_TIME_={{timestamp}}}}</nowiki></code> → {{time|_TEST_TIME_={{timestamp}}}}
:{{tld|time}} → {{time}}
:The purpose of {{para|_TEST_TIME_}} was/is to fix time for the purposes of debugging edge cases and ISO 8601 format is much easier to read than a 14-digit timestamp.
—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 14:56, 6 February 2019 (UTC)
: {{Ping|Trappist the monk}} if only for when {{tl|timestamp}} is better off substituted, like for a delayed save with a hard-coded timestamp you'd like to format. I'm glad the testcase functionality was kept, since this fit the bill quite nicely (with timezones to boot). I can transfer this functionality to my sandbox if necessary, but I figured others might find it useful too at some point. <b>~</b> <span style="font-family:Monotype Corsiva; font-size:16px;">[[User:Tom.Reding|Tom.Reding]] ([[User talk:Tom.Reding|talk]] ⋅[[WP:DGAF|dgaf]])</span> 15:33, 6 February 2019 (UTC)
: Any time you want a hard-coded timestamp, actually. And I thought about making an ISO 8601 option for {{tl|timestamp}} or even a {{tl|TimestampISO8601}}, but this was easier, unless there's already a template that outputs that. <b>~</b> <span style="font-family:Monotype Corsiva; font-size:16px;">[[User:Tom.Reding|Tom.Reding]] ([[User talk:Tom.Reding|talk]] ⋅[[WP:DGAF|dgaf]])</span> 15:38, 6 February 2019 (UTC)
::[[mw:Help:Extension:ParserFunctions##time|<code><nowiki>{{#time:}}</nowiki></code> parser function]]?
:::<code><nowiki>{{#time:Y-m-d"T"H:i:s}}</nowiki></code> → {{#time:Y-m-d"T"H:i:s}}
::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 15:58, 6 February 2019 (UTC)
:::Ah, yes that would also work. {{tl|Timestamp}} is much more convenient and intuitively named, though. <b>~</b> <span style="font-family:Monotype Corsiva; font-size:16px;">[[User:Tom.Reding|Tom.Reding]] ([[User talk:Tom.Reding|talk]] ⋅[[WP:DGAF|dgaf]])</span> 16:17, 6 February 2019 (UTC)
== How to revert time section? ==
Hi, I want to revert from like July 26th, 2019 (7/26/2019) to 26 July 2019 (26/7/2019) to suitable to my wiki which is Vietnamese Wikipedia (26 tháng 7 năm 2019). Is there anyway to do that on Module? I have created one on my Wiki with same name. [[User:Phjtieudoc|<strong style="font-size:small; color:#01A6E1"><var>phjtieudoc </var></strong>]] ([[User talk:Phjtieudoc|<em style="font-size:small; color:#FF3F1A">Talk</em>]]) 04:25, 26 July 2019 (UTC)
:P.S: Please Ping me because I don't active much on English Wikipedia. Thanks! [[User:Phjtieudoc|<strong style="font-size:small; color:#01A6E1"><var>phjtieudoc </var></strong>]] ([[User talk:Phjtieudoc|<em style="font-size:small; color:#FF3F1A">Talk</em>]]) 04:26, 26 July 2019 (UTC)
:
:@[[User:Phjtieudoc|Phjtieudoc]]: I don't completely understand your question. [[:vi:Template:Time]] does not use [[:vi:Module:Time]]. :vi:Module:Time uses [[:vi:Module:Time/data]] which is missing (the en.wiki module is [[Module:Time/data|here]]).
:
:{{tlx|time}} uses [[:mw:Help:Extension:ParserFunctions##time]] to format time/date output. Module:Time uses a table in Module:Time/data (<code>cfg['format']</code>) to hold format strings for the <code>#time:</code> parser function. You can edit the format strings in that table to modify how date and time are rendered. The default format is <code>mdy</code> (<code>cfg['default_df']</code>) so the simple <code><nowiki>{{#invoke:Time|time}}</nowiki></code> should produce something like this:
::{{time|lang=vi}}
:Does this help?
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 10:49, 26 July 2019 (UTC)
::{{ping|Trappist the monk}}. Wow. It help me a lot, but is there anyway to add the word "năm" after month, like (26 tháng 7 "năm" 2019). Thanks! [[User:Phjtieudoc|<strong style="font-size:small; color:#01A6E1"><var>phjtieudoc </var></strong>]] ([[User talk:Phjtieudoc|<em style="font-size:small; color:#FF3F1A">Talk</em>]]) 12:14, 26 July 2019 (UTC)
::::@[[User:Phjtieudoc|Phjtieudoc]]: Because [[Module:Time]] uses [[:mw:Help:Extension:ParserFunctions##time]], you can insert quoted text in the format string:
:::::<code><nowiki>{{time |df-cust=H:i, j F "năm" Y |lang=vi}}</nowiki></code> → {{time |df-cust=H:i, j F "năm" Y |lang=vi}}
::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 12:36, 26 July 2019 (UTC)
:::::{{ping|Trappist the monk}} Ok, I did it. Thanks a lot! Have a nice day! [[User:Phjtieudoc|<strong style="font-size:small; color:#01A6E1"><var>phjtieudoc </var></strong>]] ([[User talk:Phjtieudoc|<em style="font-size:small; color:#FF3F1A">Talk</em>]]) 12:54, 26 July 2019 (UTC)
== Template-protected edit request on 24 May 2020 ==
{{edit template-protected|Module:Time|answered=yes}}
Please apply [[Special:Diff/907957873/958645106]] to allow more kinds of truthy and falsy values to be passed to its boolean(y) parameters by using [[Module:Yesno]]. New test cases for "proper boolean" parameters are [[Template:Time/testcases#Parameter_hide-refresh|at the bottom of the page /testcases]]. New test case for parameter {{para|dst}}, which can also have value <code>'always'</code>, is in [[Template:Time/testcases#No_DST|section "No DST"]]. —[[User:Andrybak|andrybak]] ([[User talk:Andrybak|talk]]) 23:49, 24 May 2020 (UTC)
: {{done}} [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 02:32, 25 May 2020 (UTC)
== Template-protected edit request on 15 May 2021 ==
{{edit template-protected|Module:Time|answered=yes}}
Can we get the Hawaii–Aleutian abbreviations corrected as per [https://www.nist.gov/pml/time-and-frequency-division/local-time-faqs#zones here] and [https://www.timeanddate.com/time/zones/hast here]?
[https://en.wikipedia.org/w/index.php?title=Module%3ATime%2Fdata%2Fsandbox&type=revision&diff=1023313118&oldid=958641078 Diff here]
Testcases at [https://en.wikipedia.org/w/index.php?title=Template:Time/testcases&oldid=1023313185#change_to_Hawaii%E2%80%93Aleutian_abbreviation this ___location].
Thanks!
[[User:Joeyconnick|Joeyconnick]] ([[User talk:Joeyconnick|talk]]) 18:36, 15 May 2021 (UTC)
:Is there a reason why HADT is not an alias of HDT as HAST is an alias of HST? Should it be? Should HAST be dropped from the aliases table?
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 18:50, 15 May 2021 (UTC)
::I was just going with what was there. I guess for completeness/consistency, HADT can be added. [[User:Joeyconnick|Joeyconnick]] ([[User talk:Joeyconnick|talk]]) 18:59, 15 May 2021 (UTC)
|