> Am 11.03.2020 um 15:19 schrieb Hans Hagen <j.ha...@xs4all.nl>: > > On 3/11/2020 3:12 PM, Axel Kielhorn wrote: >>> Am 11.03.2020 um 15:01 schrieb Hans Hagen <j.ha...@xs4all.nl>: >>> >>> On 3/11/2020 2:14 PM, Axel Kielhorn wrote: >>>> >>>> Had to change it to: >>>> \startluacode >>>> function xml.finalizers.tex.MyDate(e,what,how) >>>> local ee = e[1].at[what] >>>> local t = (string.split(ee,"-")) >>>> context.date( >>>> { y = t[1], m = t[2], d = t[3] }, >>>> { how } >>>> ) >>>> end >>>> \stopluacode >>> You mean the () around the split? weird. Anyway, there's also a time >>> splitter (dedicated to Alan who needed one): >> No, sorry that’s an artifact from testing. >> I had to assign: >> local ee = e[1].at[what] >> and >> string.split(ee,"-") >> in two steps while the original had >> local t = string.split(e[1].at[what],"-") > still strange because it's one value, if it were multiple you could do
This is strange. Now it works. Earlier I had context.date complaining that it got a table and not a string. That’s why I took the t = assignment apart into pieces. Now I copied the code from the original reply and it works. Sorry for the noise. Axel ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________