Content deleted Content added
→df and mf with bad values: questions |
→df and mf with bad values: ready for test |
||
Line 113:
::Yes, I can do that, that isn't a problem. I've been working on cleaning templates that I've worked at with {{tl|Start date}} and others in which I've implemented [[Module:Date time]] to handle validation. [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 09:47, 6 April 2025 (UTC)
{{ping|Gonnym}} I'm working on this and it's finished apart from checking and thinking about the following question. The function <code>yes()</code> accepts parameters like <code>fix=yes</code> but not <code>fix=YES</code> or <code>fix=Yes</code>. That was my choice because parameters like that were introduced with Module:Age and so consistent parameter values could be required. However, lots of articles use <code>df=Y</code> or <code>df=Yes</code> etc. I would prefer to avoid lower-casing the value because wikitext like <code>df=yEs</code> is ugly and I don't think it should be accepted. Also, not lower-casing is more efficient in the module. So, I'm wondering what to accept. My plan currently accepts df=y, df=yes, df=Y, df=YES. Should we try that and see what happens? My error check only examines the <code>df</code> parameter. Any junk can still be entered for <code>mf</code> because it is ignored as it is the default at enwiki. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 07:41, 10 April 2025 (UTC)
:{{ping|Gonnym}} My code is in the sandbox for testing. As mentioned, <code>mf</code> is ignored because it is the default here. Valid <code>df</code> values are y, yes, Y, Yes, YES. The error message in the following examples would also include [[:Category:Age error]] if in an article.
:*<code><nowiki>{{Birth date and age/sandbox|1 Feb 1988}}</nowiki></code> → {{Birth date and age/sandbox|1 Feb 1988}}
:*<code><nowiki>{{Birth date and age/sandbox|1 Feb 1988|mf=yeah}}</nowiki></code> → {{Birth date and age/sandbox|1 Feb 1988|mf=yeah}}
:*<code><nowiki>{{Birth date and age/sandbox|1 Feb 1988|df=}}</nowiki></code> → {{Birth date and age/sandbox|1 Feb 1988|df=}}
:*<code><nowiki>{{Birth date and age/sandbox|1 Feb 1988|df=Yes}}</nowiki></code> → {{Birth date and age/sandbox|1 Feb 1988|df=Yes}}
:*<code><nowiki>{{Birth date and age/sandbox|1 Feb 1988|df=yeah}}</nowiki></code> → {{Birth date and age/sandbox|1 Feb 1988|df=yeah}}
{{#invoke:convert/tester|compare|Age|prefix=:*}}
:Please have a look. I can update the main module when ready. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 06:26, 12 April 2025 (UTC)
|