+ /**
+ * Day of week to begin calendar month view
+ */
+ get_preference("weekstart", buf, sizeof buf);
+ if (buf[0] == 0) strcpy(buf, "17");
+ wprintf("<tr class=\"even\"><td>");
+ wprintf(_("Week starts on:"));
+ wprintf("</td><td>");
+
+ wprintf("<select name=\"weekstart\" size=\"1\">\n");
+
+ for (i=0; i<=1; ++i) {
+ tt = time(NULL);
+ localtime_r(&tt, &tm);
+ tm.tm_wday = i;
+ wc_strftime(daylabel, sizeof daylabel, "%A", &tm);
+
+ wprintf("<option %s value=\"%d\">%s</option>\n",
+ ((atoi(buf) == i) ? "selected" : ""),
+ i, daylabel
+ );
+ }
+
+ wprintf("</select>\n");
+ wprintf("</td></tr>\n");
+