Quote:
Originally Posted by ownedbycats
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