View Single Post
Old Today, 05:10 AM   #1541
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,506
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by mijkala View Post
I'm using an action chain to clean up my status section for fics and it's been working well, until I noticed one that won't change? Here's the code I have for both

Code:
program:
now = format_date(today(),'iso');
updated = $$#ao3_last_updated;
status = $#status;

	if 
		status=='In-Progress'
		&& days_between(now, updated) ># 183
	then 
		'Dormant'

	elif
		status=='In-Progress'
		&& days_between(now, updated) ># 900
	then 
		'Hiatus'

	else 
		status
	fi
Of note:
  • The only check that will succeed is "># 183". Both 500 and 1000 are larger than 183. You should reverse the two checks to look for "># 900" first.
  • today() returns an ISO formatted date. You don't need to format it again.
As for why the fic isn't updated, I suspect that #ao3_last_updated doesn't contain what you think or is formatted in some way where the conversion of the string to a date/time is failing. Without seeing the actual metadata in the library for the book we can't say any more. The book itself isn't relevant.
chaley is offline   Reply With Quote