]> code.citadel.org Git - citadel.git/blobdiff - webcit/calendar_tools.c
* fetching the 12/24 Hours switch from config over and over is expansive. (gprof...
[citadel.git] / webcit / calendar_tools.c
index 304530f784d080ab8b913c26acfa392d86f0a84a..edb17de924caf8ce698331de81e47f5e36331894 100644 (file)
@@ -52,9 +52,9 @@ void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix) {
        time_t monthselect_time;
        struct tm monthselect_tm;
        char monthselect_str[32];
-       char calhourformat[16];
-
-       get_preference("calhourformat", calhourformat, sizeof calhourformat);
+       int time_format;
+       
+       time_format = get_time_format_cached ();
 
        now = time(NULL);
        localtime_r(&now, &tm_now);
@@ -116,7 +116,7 @@ void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix) {
        wprintf("<SELECT NAME=\"%s_hour\" SIZE=\"1\">\n", prefix);
        for (i=0; i<=23; ++i) {
 
-               if (!strcasecmp(calhourformat, "24")) {
+       if (time_format == WC_TIMEFORMAT_24) {
                        wprintf("<OPTION %s VALUE=\"%d\">%d</OPTION>\n",
                                ((tm.tm_hour == i) ? "SELECTED" : ""),
                                i, i