12-16-2020, 02:03 PM | #1 |
Custom User Title
Posts: 8,755
Karma: 62032371
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Icon based on dates
Is this possible to do?
Display an icon if: #read (bool) is set to "Yes" #fanficupdated is newer than #lastread (both dates, only if neither are undefineds) I was thinking the days_between could be used and then parse whether the results are positive or negative. Not sure if that's even possible though, or the best way to go about it. |
12-16-2020, 04:43 PM | #2 |
Grand Sorcerer
Posts: 11,765
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Moderator Notice
Moved to its own thread |
Advert | |
|
12-16-2020, 04:46 PM | #3 |
Grand Sorcerer
Posts: 11,765
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
You can do this with an icon rule, something like the following:
Code:
program: d1 = raw_field('#mydate'); d2 = raw_field('pubdate'); if and(field('#mybool_test') == 'yes', d1 != 'none', d2 != 'none') then if days_between(d1, d2) ># 0 then 'yes.png' else 'no.png' fi else # Don't want an icon if the conditions aren't true. The else clause can be removed '' fi |
12-16-2020, 08:37 PM | #4 |
Custom User Title
Posts: 8,755
Karma: 62032371
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
That works! Thank you. Now I just need to dig up a better icon for "resume reading."
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Icon] Modern Mac theme based on SF Symbols | utterances | Development | 4 | 01-06-2022 05:17 PM |
ISO Dates | BetterRed | Calibre | 1 | 02-01-2019 11:14 PM |
Publication Dates | kpjgpm | Marvin | 0 | 12-08-2017 10:01 AM |
REGEX And Dates | thomasm1964 | Conversion | 1 | 03-03-2017 11:36 PM |
Published Dates | bigbird1227 | Library Management | 7 | 06-10-2011 10:40 AM |