From: Pablo Rodriguez <oinos@gmx.es>
To: ntg-context@ntg.nl
Subject: Re: date calculated with currentdate plus n days
Date: Mon, 13 Aug 2018 17:57:25 +0200 [thread overview]
Message-ID: <1a84a604-9a8f-3a03-5a6e-6126034f5a62@gmx.es> (raw)
In-Reply-To: <2fa7abc7-6581-9581-da7d-a3070d11bf08@mailbox.org>
On 08/13/2018 05:19 PM, Jan U. Hasecke wrote:
> Hi all,
>
> I want to insert a due date for payments in my invoice and I would like
> to calculate it from \currentdate. Something like
>
> define \duedate = \currentdate plus 10 days
>
> Is this possible?
Hi Jan-Ulrich,
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,
Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2018-08-13 15:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-13 15:19 Jan U. Hasecke
2018-08-13 15:57 ` Pablo Rodriguez [this message]
2018-08-13 17:37 ` Jan U. Hasecke
2018-08-13 23:46 ` Henri Menke
2018-08-14 5:29 ` Pablo Rodriguez
2018-08-14 7:24 ` Henri Menke
2018-08-14 14:58 ` Pablo Rodriguez
2018-08-15 5:46 ` Use of context in lua (was: date calculated with currentdate plus n days) Jan U. Hasecke
2018-08-15 6:45 ` Use of context in lua Henri Menke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1a84a604-9a8f-3a03-5a6e-6126034f5a62@gmx.es \
--to=oinos@gmx.es \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).