Skip to main content

Hi, I’m trying to add a “X days until Christmas” line to my email where X is the difference between today’s date and 25th Dec, as a count.

I’ve tried using Django’s timeuntil function:

{{ xmas|timeuntil:today }}

but unsure how to define “xmas”? {% with xmas=date(2023, 12, 25) %} is giving an error

Would appreciate any help with this! Hoping to avoid using a timer as I want it to look human

Hi there @yayifications

 

Thanks for sharing your question with us! Happy to help! 

 

I would recommend utilizing a countdown timer for this use case! However, I do believe that your xmas date is configured incorrectly about as well. I believe the date would need to be as follows instead of the commas.

date:'Y-m-d'

 

Thanks for participating in the Community!

-Taylor 


Reply