[NTG-context] date calculated with currentdate plus n days

Henri Menke henrimenke at gmail.com
Tue Aug 14 01:46:20 CEST 2018


On top of that I recommend to use context.date to get the correct 
formatting according to the current language options:

\starttext

\def\duedate{\ctxlua{
   local t = os.date('*t', os.time()+ 10 * 24 * 3600)
   context.date{ d = t.day, m = t.month, y = t.year }
}}

\duedate

\stoptext

On 14/08/18 05:37, Jan U. Hasecke wrote:
> On 13.08.2018 17:57, Pablo Rodriguez wrote:
> 
>> if you don’t mind using Lua, here you have it:
>>
>>      \starttext
>>      \def\duedate{\cldcontext{os.date('\letterpercent d/\letterpercent
>>          m/\letterpercent Y', os.time()+ 10 * 24 * 3600)}}
>>
>>      \duedate
>>      \stoptext
>>
>> Just in case it helps,
> 
> Thanks!
> 
> I thought it should be possible with lua, but I found no entry point to
> use lua in context by defining new commands.
> 
> juh
> 
> 
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context at 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
> ___________________________________________________________________________________
> 


More information about the ntg-context mailing list