diff options
author | default <nobody@localhost> | 2023-06-28 10:50:17 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-06-28 10:50:17 +0200 |
commit | e9711f94d06c76d213e9d43f9d228a4cf11fdc1a (patch) | |
tree | 91589a337f78bd43425599983bd3bddf57539351 | |
parent | 833540d090769436c69f294429df85e10919c015 (diff) |
Skip leading zeros en poll closing time.
-rw-r--r-- | html.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1071,8 +1071,12 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local, if (t1 > 0 && t1 > t0) { time_t diff_time = t1 - t0; xs *tf = xs_str_time_diff(diff_time); + char *p = tf; - xs *s1 = xs_fmt("<p>%s %s</p>", L("Closes in"), tf); + /* skip leading zeros */ + for (; *p == '0' || *p == ':'; p++); + + xs *s1 = xs_fmt("<p>%s %s</p>", L("Closes in"), p); c = xs_str_cat(c, s1); } } |