View Single Post
Old 11-03-2024, 01:44 AM   #747
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,382
Karma: 79699999
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Question: I have a stored template, colours_daysbetween(), formatted as colours_daysbetween($#lastread, '#00aaff', '#69cfff', '#9bdeff').

Code:
program:

	arguments(date, colourA, colourB, colourC);
	now = format_date(today(), 'yyyy-MM-dd');

	if days_between(now,date) <#1 then colourA
	elif days_between(now,date) <=# 14 then colourB
	elif days_between(now,date) <=# 30 then colourC 
	fi
I don't remember where I got this (I possibly wrote it myself) but is there any particular reason to use a format_date() instead of just 'today()'? The template works when tested with the latter.
ownedbycats is offline   Reply With Quote