Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Search
Search
Appearance
Create account
Log in
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Editing
Module talk
:
Date time
Add topic
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
Add topic
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Should nil values be confined to the least significant values? == Should the module be modified to require that there be no nil values between the most significant value and the least significant values. For example, if month is nil but day is 1, should that trigger an error? Since a time zone is sometimes handled by some of the templates that call this, it might be useful to either validate the time zone, or at least return the number of the least significant non-nil value. For example, if all the values are non-nil for minute and above, it makes sense to have a non-nil time zone, and returning 5 would provide that information to the calling function. If the least significant non-nil value were day, it's questionable whether it's valid to use a time zone. [[User:Jc3s5h|Jc3s5h]] ([[User talk:Jc3s5h|talk]]) 23:18, 26 February 2025 (UTC) :Since this module is meant for a date validation, I don't think a date with a day and year and without a month can pass any validation. So I would say that it should trigger an error. Your question has also lead me to notice that currently such a call triggers an unexpected error in the code. :Regarding time zones. I haven't touched that, but if you can either write the code or have a complete detailed plan on what passes and what fails, I can see to adding it. [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 10:32, 27 February 2025 (UTC) ::I have [[Module:Zodiac date|exactly one]] Lua module under my belt, and I own a book about Lua, so I should have no problem writing the code. (What's the emoji for sarcasm?} I have a few questions before I dig into it. ::Currently Start date correctly renders a least significant parameter (LSP) of month, or minute, but not hour. ISO 8601 can express a time with a precision of hours and a time zone correctly (example 2025-02-27T6Z). So should we require a LSP of minute or second to allow a time zone, or should we also allow hour? ::Another thought is whether the production of the character string for the ISO 8601 should be brought into this module, so we don't have different implementations in Start date, End date, Birth date, Death date, and wherever else the module is invoked. (I don't know how to list what pages invoke a module.) [[User:Jc3s5h|Jc3s5h]] ([[User talk:Jc3s5h|talk]]) 11:59, 27 February 2025 (UTC) :::In terms of dates, speak to me like a complete idiot as I don't understand what LSP is. Since I don't understand it, I also don't understand what is missing or needs to be checked. If you tell me "it needs to error when {{var|x}} happens", I can work with that. ::: I've added tests to [[Module talk:Date time validation/testcases]] so you can see what passes and what fails. You can add new tests to [[Module:Date time validation/testcases]] if you feel some are missing. :::Regarding the production of the string, that is currently outside the scope of this module, as it only validates the data, not creates it. If needed, we can create a different module for the creation of the data (it's better to have defined scope for code). [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 12:09, 27 February 2025 (UTC) {{od|3}} Here are a few test cases <syntaxhighlight lang="wikitext">{{Start date| 2021 |4|27||||Z|df=y}}</syntaxhighlight> Questionable rendered date: {{Start date| 2021 |4|27||||Z|df=y}} Incorrect ISO 8601: 2021-04-27Z <syntaxhighlight lang="wikitext">{{Start date| 2022 |4|27|8|||Z|df=y}}</syntaxhighlight> Incorrect rendered date: {{Start date| 2022 |4|27|8|||Z|df=y}} Correct ISO 8601: 2022-04-27T08Z <syntaxhighlight lang="wikitext">{{Start date| 2023 |4|27|8|12||Z|df=y}}</syntaxhighlight> Correct rendered date: {{Start date| 2023 |4|27|8|12||Z|df=y}} Correct ISO 8601: 2023-04-27T08:12Z All the ISO 8601 values were copied from the html of the rendered page [[User:Jc3s5h/sandbox4]]. <!-- Template:Unsigned --><small class="autosigned">β Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Jc3s5h|Jc3s5h]] ([[User talk:Jc3s5h#top|talk]] β’ [[Special:Contributions/Jc3s5h|contribs]]) 12:39, 27 February 2025 (UTC)</small> :Are the first two incorrect dates because they use a timezone without a time? I need you to be as clear as possible why something fails [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 11:48, 5 March 2025 (UTC) ::This test case: ::<syntaxhighlight lang="wikitext">{{Start date| 2021 |4|27||||Z|df=y}}</syntaxhighlight> ::The rendering for the reader, 27 April 2021 (UTC), specifies something that might not be representable in ISO 8601. Since the whole point of the template is to provide the metadata, it probably shouldn't support a date-time that can't be represented in ISO 8601. ::Also, it renders incorrect metadata 2021-04-27Z because ISO 8609 requires a T between the date and time. Also the standard isn't clear if it's possible to have an ISO date-time with a time zone offset but no time. "2021-04-27TZ" might be wrong or right, it's hard to be sure. ::This test case: ::<syntaxhighlight lang="wikitext">{{Start date| 2022 |4|27|8|||Z|df=y}}</syntaxhighlight> {{Start date| 2022 |4|27|8|||Z|df=y}} ::Renders incorrectly to the reader as 27 April 2022 (UTC). It's incorrect because the template invocation contains the hour but the rendered version makes no mention of the hour. [[User:Jc3s5h|Jc3s5h]] ([[User talk:Jc3s5h|talk]]) 16:09, 5 March 2025 (UTC) :::I'm not understanding if the issue is a broken syntax as you wrote: {{tq|it renders incorrect metadata 2021-04-27Z because ISO 8609 requires a T between the date and time}}, which in that case, we can add that syntax. Or if the issue is that a date and timezone without a time is invalid. :::I'll ask again, I need you to write something like this: :::<syntaxhighlight lang="wikitext">Invalid usage: <syntaxhighlight lang="wikitext">{{Start date| 2021 |4|27||||Z|df=y}}< /syntaxhighlight>: - a timezone without hour is invalid.</syntaxhighlight> :::And do this for each thing that isn't working correctly. Anything else I can't work with. [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 16:22, 5 March 2025 (UTC) ::This test case: ::<syntaxhighlight lang="wikitext">{{Start date| 2021 |4|27||||Z|df=y}}</syntaxhighlight> ::I thought this test case had a problem because I wasn't sure if a time zone could be represented in ISO 8601 without a time of day. But, in the ISO standard, buried in a section about something else, '''5.5.1 Means of specifying time intervals''', I found this example: :::EXAMPLE 2 β2018-01-15+05:00/2018-02-20β is equivalent to β2018-01-15+05:00/2018-02-20+05:00β as the β+05:00β time shift also applies to the expression after the separator. ::So the ISO date I claimed was incorrect, 2021-04-27Z, was actually correct. ::This test case: ::<syntaxhighlight lang="wikitext">{{Start date| 2022 |4|27|8|||Z|df=y}}</syntaxhighlight> {{Start date| 2022 |4|27|8|||Z|df=y}} ::Renders incorrectly to the reader as 27 April 2022 (UTC). It's incorrect because the template invocation contains the hour but the rendered version makes no mention of the hour. [[User:Jc3s5h|Jc3s5h]] ([[User talk:Jc3s5h|talk]]) 16:09, 5 March 2025 (UTC) :::So should the template produce 08:00, April 27, 2022 or should the timezone be removed? [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 16:50, 5 March 2025 (UTC) ::::I believe the template should produce 08:00, April 27, 2022 (UTC). <!-- Template:Unsigned --><small class="autosigned">β Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Jc3s5h|Jc3s5h]] ([[User talk:Jc3s5h#top|talk]] β’ [[Special:Contributions/Jc3s5h|contribs]]) 16:56, 5 March 2025 (UTC)</small> :::::ok, so {{mlx|Date time validation/sandbox|generate_date|2000|02|29|11|<nowiki/>|<nowiki/>|Z}} -> {{#invoke:Date time validation/sandbox|generate_date|2000|02|29|11|||Z}}. :::::Take a look at [[Module talk:Date time validation/testcases]] (ignore the 3 fails atm, I'll fix them tomorrow) and see if there is anything else is missing. [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 18:46, 5 March 2025 (UTC) {{od|5}}I see a valid test case with a full time of day: <syntaxhighlight lang="wikitext">{{#invoke:Date time validation/sandbox|generate_date|2000|02|29|11|5|29|Z|df=y}} </syntaxhighlight> I suggest a valid testcase with only the hour specified: <syntaxhighlight lang="wikitext">{{#invoke:Date time validation/sandbox|generate_date|2000|02|29|11|||Z|df=y}} </syntaxhighlight> [[User:Jc3s5h|Jc3s5h]] ([[User talk:Jc3s5h|talk]]) 19:33, 5 March 2025 (UTC) :My comment right above this has one for 11:00:00, February 29, 2000. [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 19:53, 5 March 2025 (UTC) ::Yes, but collections of test cases typically are run after every change, so test cases scattered among talk pages are inherently different from a collection of test cases. [[User:Jc3s5h|Jc3s5h]] ([[User talk:Jc3s5h|talk]]) 22:34, 5 March 2025 (UTC)
Summary:
Please note that all contributions to LarpOfHoi4 Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LarpOfHoi4 Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Pages included on this page:
Template:Main other
(
edit
)
Template:Mlx
(
edit
)
Template:Module link expanded
(
edit
)
Template:Od
(
edit
)
Template:Start date
(
edit
)
Template:Tq
(
edit
)
Template:Var
(
edit
)
Module:Arguments
(
edit
)
Module:Check for unknown parameters
(
edit
)
Module:Date time
(
edit
)
Module:Date time validation/sandbox
(
edit
)
Module:Separated entries
(
edit
)
Module:TableTools
(
edit
)
Search
Search
Editing
Module talk
:
Date time
Add topic