View Single Post
Old 07-22-2023, 12:05 PM   #645
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,475
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
I have a template that produces a list of dates all formatted the same (e.g. '2020-04-16, 2023-07-10').

How do I apply format_date() to these?
Best would be to do it when you first build the list.

To do it after the fact, use something like this template:
Code:
program:
	date_list = '2020-04-16, 2023-07-10';
	formatted_list = '';
	for date in date_list:
		formatted_list = list_join(', ', formatted_list, ', ', format_date(date, 'dd-MMM-yyyy'), ', ')
	rof;
	formatted_list
Given your example input, it produces
Code:
16-Apr-2020, 10-Jul-2023
chaley is offline   Reply With Quote