Module talk:ISOdate

Contents

{{editrequest}}
As for Module:Date, I modified the sandbox version to handle time zones. The number of combinations of format strings was getting a bit out of hand, so this version parses date, time and time zone separately. Please examine and copy to the live module if desired. --ghouston (talk) 07:39, 6 December 2016 (UTC)

--ghouston, I am a bit afraid to split date and time parsing. The dates that have time are allowed to have 1 digit days or months because it is less likely that those will be confused with something else. Dates with year and month are much more restrictive with other string at the end and less restrictive if whole string matches. I would like to preserve that. Can we just add a standard case with time zone? --Jarekt (talk) 03:56, 10 December 2016 (UTC)

I overlooked that detail. I was puzzled about why it accepted 1 digit days and months at all, when it's not a valid ISO 8601 format. Would it be an option to simply reject them? I'm accepting all the time zone variations: Z, +hhmm, -hhmm, +hh:mm, +hh etc., (although only with a hyphen and not a Unicode minus sign) and time zones can be attached to times that have hours/minutes/seconds or just hours/minutes, so there are a lot of combinations. I guess it wouldn't be hard to add some code to reject the single digit days or months when there's no time attached. --ghouston (talk) 06:58, 10 December 2016 (UTC)

I made that last change, so now it will reject 1 digit days and months if the time isn't present. --ghouston (talk) 03:30, 30 December 2016 (UTC)

Now I'm not sure I understand what you mean. The current version accepts 1 digit days and months when the time isn't present, even if it's not the entire string. E.g., {{ISOdate|1-2-3 stuff}} gives 3 February 0001 stuff. --ghouston (talk) 21:49, 2 January 2017 (UTC)

@Jarekt: Line 58 mw.ustring.match( input, '^+?(-?%d%d?%d?%d?)-' ) allows unicode dates such as those in File:Baleghata_khal.png, but line 60 mw.ustring.format( '%04i', input ) does not allow those and fails with Lua error in Module:ISOdate at line 60: bad argument #2 to 'format' (number expected, got string). How should this be fixed? --Zhuyifei1999 (talk) 21:55, 24 August 2017 (UTC)

Zhuyifei1999, Yes I see {{ISOyear|০৪-১১-২০১৬}} gave error. I think it is fixed now. --Jarekt (talk) 02:42, 26 August 2017 (UTC)

IKhitron, I see what the issue is: {{ISOdate|1={{Commons:Picture of the Year/2017/Rules/Time/data|r1end}}|lang=he}} gives "24 ביוני 2018, 23:59:59". It is not an issue with Module:ISOdate, but with Module:Date and Module:I18n/date where we do "customizing for each language":