Module talk:Date time
Appearance
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. 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. Gonnym (talk) 10:32, 27 February 2025 (UTC)