Allow extended formats for durations
Use print_datediff() to print durations. This allows for using something like "%(duration:%EH:%M)". Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
ae93db284e
commit
99b39e5d0d
@ -1325,7 +1325,11 @@ void print_apoint(const char *format, long day, struct apoint *apt)
|
|||||||
print_date(apt->start, day, extformat);
|
print_date(apt->start, day, extformat);
|
||||||
break;
|
break;
|
||||||
case FS_DURATION:
|
case FS_DURATION:
|
||||||
printf("%ld", apt->dur);
|
/* Backwards compatibility: Use epoch by
|
||||||
|
* default. */
|
||||||
|
if (*extformat == '\0')
|
||||||
|
strcpy(extformat, "epoch");
|
||||||
|
print_datediff(apt->dur, extformat);
|
||||||
break;
|
break;
|
||||||
case FS_ENDDATE:
|
case FS_ENDDATE:
|
||||||
print_date(apt->start + apt->dur, day,
|
print_date(apt->start + apt->dur, day,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user