← Back to team overview

zim-wiki team mailing list archive

Re: Getting dates into template

 

On Thu, Feb 23, 2012 at 10:33 AM, Iago Mosqueira
<iago.mosqueira@xxxxxxxxx>wrote:

> Hi,
>
> I am trying to modify the Calendar.txt template when used in weekly mode
> to show
>
> ===== Mon 1 Jan =====
>
> ===== Tue 2 Jan ======
>
> and so on. The calendar plugin only gives variables for the start and
> end dates of the week, so how I can tell strftime to output the other
> days? I tried with
>
> strftime("%a %d %b", calendar_plugin.date + datetime.timedelta(days=1))
>
> but did not work. I am probably doing something very wrong, as I have
> never programmed in python before.
>

The reason it does not work is that the template does not allow arbitrary
python code. The few functions that are available are hard coded in the
template formatting.

So doing something like this would require additional functions to the
template engine.

Regards,

Jaap

Follow ups

References