On 16/12/2024 22:18, Pablo Rodriguez via ntg-context wrote:
It seems that it is too complex for me (and I have already invested two
afternoons in this).

For some reason, not meant to be in my case,

like everyday for one year

8<---

\startluacode
function userdata.now(dd)
  local wdays = {"Sun ", "Mon ", "Tue ", "Wed ", "Thu ", "Fri ", "Sat "}
  local z = os.date("*t", os.time())
local nn = os.date("*t", os.time{year=z.year, month=z.month, day=z.day+dd})
  --context(wdays[nn.wday] .. nn.year .. "-" .. nn.month .. "-" .. nn.day)
context(string.format("%s %04d-%02d-%02d ", wdays[nn.wday], nn.year, nn.month, nn.day))
end
\stopluacode
\starttext
\tt
Today is \ctxlua{userdata.now(0)}

\dorecurse{366}{\ctxlua{userdata.now(\recurselevel)}\\ }

\stoptext

--->8



( i'm not fluent in lua, so there might be a much better way to handle it ;-)

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to