|
|
#1 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,338
Karma: 79528341
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. |
|
|
|
|
|
#2 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Moderator Notice
Moved to its own thread |
|
|
|
|
|
#3 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
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
|
|
|
|
|
|
#4 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,338
Karma: 79528341
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 | 9 | 07-18-2024 12:07 AM |
| 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 |