Custom column: "pubdate" and "ifempty"
I've been using code like "{languages:ifempty(-)}" in a custom combined column successfully. I've been trying a similar approach for a custom formatted "pubdate", but I can't figure out the correct syntax. Could someone give me a simple example please? I'm not a "real" coder, so the Calibre manual is much too complicated for me... I'd like to have the pubdate formatted as "MMM yyyy", with a "-" character if the field is empty (= no pubdate set). Date formatting works fine ("{:'format_date(raw_field('pubdate'),'yyyy')'} "), and "ifempty" works fine, too - I just don't know how to combine the functions properly.
EDIT: solved the problem by creating another custom column which stores the formatted pubdate. I'd still be interested in knowing if there's a way to get the formatted date without using an additional column.
Last edited by StillReading; 04-05-2015 at 08:03 AM.
|