* honor 24 / am/pm setting in the bubbles and some other places too.
authorWilfried Göesgens <willi@citadel.org>
Tue, 25 Sep 2007 21:12:27 +0000 (21:12 +0000)
committerWilfried Göesgens <willi@citadel.org>
Tue, 25 Sep 2007 21:12:27 +0000 (21:12 +0000)
webcit/fmt_date.c

index 3c8210f9ae100a47e3419b0c01f035863da54f98..ff0df01be8ad3816d31ed7981d14a90aa36210c5 100644 (file)
@@ -72,12 +72,18 @@ void fmt_date(char *buf, time_t thetime, int brief)
                if ((tm.tm_year == today_tm.tm_year)
                  &&(tm.tm_mon == today_tm.tm_mon)
                  &&(tm.tm_mday == today_tm.tm_mday)) {
-                       wc_strftime(buf, 32, "%l:%M%p", &tm);
+                       if (time_format == WC_TIMEFORMAT_24) 
+                               wc_strftime(buf, 32, "%k:%M", &tm);
+                       else
+                               wc_strftime(buf, 32, "%l:%M%p", &tm);
                }
                /** Otherwise, for messages up to 6 months old, show the
                 * month and day, and the time */
                else if (today_timet - thetime < 15552000) {
-                       wc_strftime(buf, 32, "%b %d %l:%M%p", &tm);
+                       if (time_format == WC_TIMEFORMAT_24) 
+                               wc_strftime(buf, 32, "%b %d %k:%M", &tm);
+                       else
+                               wc_strftime(buf, 32, "%b %d %l:%M%p", &tm);
                }
                /** older than 6 months, show only the date */
                else {