Date formatting codes with a hyphen-minus (-) does not seem to work[edit]
Using any of the formatting codes with "-" i.e. %-Y, %-H, %-M, %-S, %-j, and %-I while specifying the date format does not work. Is this intended or is this a bug? — Jeluang Terluang (talk) 09:12, 3 February 2021 (UTC)[reply]
Dignidad Ahora is a new article with two errors from {{Cite tweet}}, namely "Lua error in Module:TwitterSnowflake at line 45: attempt to index local 'x' (a nil value)." I'll fix them soon as they are due to the date not being valid as an English date (for example, date=6 de enero de 2021). Previewing the following shows the error.
local date = Date(frame.args.date) or 0 -- if we error here, then an input of no date causes an error, which is contrary to the entire way {{TwitterSnowflake/datecheck}} works
return date - twitterdate
The first line sets date to 0 and the second line tries to subtract twitterdate (which is a valid date from Module:Date) from zero. Module:Date cannot do that so it returns nil and that gives the error above. A better error message would be something like:
return (date - twitterdate) or error("parameter 'date' is invalid", 0)
Thanks. I would have fixed it but the "or 0 -- if we error here..." made me think that something special was wanted. The question to be resolved is what should happen if the given date is invalid. Johnuniq (talk) 03:40, 28 August 2021 (UTC)[reply]
Good question. It should probably be an error - I'd have it categorize in . However, as the date parameter isn't necessary, an omitted date parameter should not throw an error, and the error shouldn't be a fatal one (still calculate the date from the snowflake and display that, but also display error text). Elli (talk | contribs) 03:51, 28 August 2021 (UTC)[reply]
The TwitterSnowflake module appears to fail with a script error on invalid dates. Here's one I found in the wild:
{{Cite tweet|number=1055907442213580800|user=conangray|title=my middle name is "lee" so all i gotta do is name my child "fam"|author=Conan Gray|date=October 98, 2098}}