03-22-2024, 07:48 PM | #661 |
Custom User Title
Posts: 8,620
Karma: 61176603
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
format_date and partial dates
I'm using this template to display a list of dates formatted as 'yyyy-MM-dd' as 'MMM d yyyy': Code:
program: new_dates = ''; for dates in '#datesread': converted = format_date(dates, 'MMM d yyyy'); new_dates = list_union(new_dates, converted, ',') rof What should I do here to get '2017, Jun 13 2023'? Alternately, I'd be fine removing the partial dates. Last edited by ownedbycats; 03-22-2024 at 10:04 PM. |
03-23-2024, 09:20 AM | #662 | |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
You don't say if you can have a date like '2020-05'. Assuming you can, a variation of this template might give you what you want. Code:
program: new_dates = ''; for dates in '2020, 2021-05, 2022-03-10': if list_count(dates,'-') ==# 3 then converted = format_date(dates, 'MMM d yyyy') elif '-' in dates then converted = re(format_date(dates, 'MMM d yyyy'), ' 15 ', ' ') else converted = dates fi; new_dates = list_union(new_dates, converted, ',') rof Code:
Mar 10 2022, May 2021, 2020 |
|
03-23-2024, 01:20 PM | #663 |
Custom User Title
Posts: 8,620
Karma: 61176603
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I have only yyyy and yyyy-mm-dd, but that template worked on all the books I tested.
I didn't think of using a list_count with a - separator. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Library Management: various questions not worth their own thread | ownedbycats | Library Management | 138 | 04-23-2024 11:49 AM |
[Metadata Source Plugin] Questions regarding parse select, docs and ref templates | Boilerplate4U | Development | 13 | 07-07-2020 02:35 AM |
Questions on Kobo [Interfered with another thread topic] | spdavies | Kobo Reader | 8 | 10-12-2014 11:37 AM |
[OLD Thread] Some questions before buying the fire. | darthreader13 | Kindle Fire | 7 | 05-10-2013 09:19 PM |
Thread management questions | meme | Feedback | 6 | 01-31-2011 05:07 PM |