ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* tex.month can't be overridden like tex.day and tex.year
@ 2019-05-02 15:54 Tristan Stenner
  2019-05-06 14:54 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Tristan Stenner @ 2019-05-02 15:54 UTC (permalink / raw)
  To: ntg-context

Dear list,

in the following document I can set the date as seen by LuaTeX so the
date functions use a different date:

---
\starttext
\ctxlua{tex.year=1980; tex.month=1; tex.day=15}

% Taken from https://wiki.contextgarden.net/Command/date,
% outputs 15 may 1980
\date[m=1][day,~,{\monthshort\normalmonth},~,year]

% outputs January 15, 1980
\ctxlua{context.date{m=tex.month};}
\stoptext
---

This works for all parts of the date (even the weekday), except the
month. I've looked through the core-con.lua and found nothing that would
explain this (or what I'd need to change), as the tex.month is properly set.

Best regards
Tristan
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: tex.month can't be overridden like tex.day and tex.year
  2019-05-02 15:54 tex.month can't be overridden like tex.day and tex.year Tristan Stenner
@ 2019-05-06 14:54 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2019-05-06 14:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Tristan Stenner

On 5/2/2019 5:54 PM, Tristan Stenner wrote:
> Dear list,
> 
> in the following document I can set the date as seen by LuaTeX so the
> date functions use a different date:
> 
> ---
> \starttext
> \ctxlua{tex.year=1980; tex.month=1; tex.day=15}
> 
> % Taken from https://wiki.contextgarden.net/Command/date,
> % outputs 15 may 1980
> \date[m=1][day,~,{\monthshort\normalmonth},~,year]
> 
> % outputs January 15, 1980
> \ctxlua{context.date{m=tex.month};}
> \stoptext
> ---
> 
> This works for all parts of the date (even the weekday), except the
> month. I've looked through the core-con.lua and found nothing that would
> explain this (or what I'd need to change), as the tex.month is properly set.
\meaning\day   \par
\meaning\month \par
\meaning\year  \par

\meaning\normalday   \par
\meaning\normalmonth \par
\meaning\normalyear  \par


context (re)defines \month so you need to use the original meanings 
(\normal..)

Jams

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-06 14:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-02 15:54 tex.month can't be overridden like tex.day and tex.year Tristan Stenner
2019-05-06 14:54 ` Hans Hagen

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).