timekeeper

[Abandoned unfinished] CGI web application in C for time tracking. (My first, just a learning project)
Log | Files | Refs | README

commit 6cb72536c544a6a7eaf1e5bd40b8352095a74e95
parent f24da15b101d9ff59a2e9e788ecb7cabc1c5a89f
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date:   Sun, 10 Mar 2024 22:07:48 -0700

Only use <time> if the date field is non-zero

Otherwise obviously the datetime value would be invalid.

Diffstat:
Mpages/main.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/pages/main.c b/pages/main.c @@ -143,7 +143,10 @@ printtime(struct pagedata *pd, time_t *times, unsigned int len) if ((status = khtml_attr(&pd->html, KELEM_TH, KATTR_SCOPE, "row", KATTR__MAX)) != KCGI_OK || + (date[0] && ( + (status = khtml_elem(&pd->html, KELEM_TIME)) != KCGI_OK || (status = khtml_puts(&pd->html, date)) != KCGI_OK || + (status = khtml_closeelem(&pd->html, 1)) != KCGI_OK)) || (status = khtml_closeelem(&pd->html, 1)) != KCGI_OK) return status;