View Single Post
Old 06-27-2024, 04:50 AM   #682
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,495
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Question:

Code:
program:
	status = readstatus();
	times = $$#timesread;

	switch_if(
		status=='read', 'Read',
		status=='didnotfinish', 'Did Not Finish',
		status=='currentlyreading', if times >#0 then 'Currently Rereading' else 'Currently Reading' fi,
		status=='toberead', if times >#0 then 'To Be Reread' else 'To Be Read' fi,
		status=='unread', if 'readinggoal:' in $#admintags then 'Backlog' else 'Unread' fi,
		''
	)
On line 10, I'd like to change the criteria to instead check for readinggoal:{currentyear} - the obvious is just check for a literal 'readinggoal:2024' but is there a way to do this automagically?
Try using
Code:
if 'readinggoal:' & format_date(today(), 'yyyy') in $#admintags then 'Backlog' else 'Unread' fi
chaley is offline   Reply With Quote