struct tm tm;
const int span = 10;
int all_day_event = 0;
+ char calhourformat[16];
+
+ get_preference("calhourformat", calhourformat, sizeof calhourformat);
now = time(NULL);
localtime_r(&now, &tm_now);
wprintf("Hour: ");
wprintf("<SELECT NAME=\"%s_hour\" SIZE=\"1\">\n", prefix);
for (i=0; i<=23; ++i) {
- wprintf("<OPTION %s VALUE=\"%d\">%s</OPTION>\n",
- ((tm.tm_hour == i) ? "SELECTED" : ""),
- i, hourname[i]
- );
+
+ if (!strcasecmp(calhourformat, "24")) {
+ wprintf("<OPTION %s VALUE=\"%d\">%d</OPTION>\n",
+ ((tm.tm_hour == i) ? "SELECTED" : ""),
+ i, i
+ );
+ }
+ else {
+ wprintf("<OPTION %s VALUE=\"%d\">%s</OPTION>\n",
+ ((tm.tm_hour == i) ? "SELECTED" : ""),
+ i, hourname[i]
+ );
+ }
+
}
wprintf("</SELECT>\n");