X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fcalendar_tools.c;h=5fffee44c3b692e5358fa4c78629165fde99c176;hb=fb6f6fa4ec4e3277e30d84326d48e6850822d318;hp=17862aa6c27cc29c2a6130c154e71ab62733bab1;hpb=cf934431c7c8c1091b38c0b374f6a3b9293841ca;p=citadel.git
diff --git a/webcit/calendar_tools.c b/webcit/calendar_tools.c
index 17862aa6c..5fffee44c 100644
--- a/webcit/calendar_tools.c
+++ b/webcit/calendar_tools.c
@@ -1,13 +1,23 @@
/*
- * $Id$
- *
* Miscellaneous functions which handle calendar components.
+ *
+ * Copyright (c) 1996-2012 by the citadel.org team
+ *
+ * This program is open source software. You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*/
#include "webcit.h"
#include "webserver.h"
+#include "time.h"
+#include "calendar.h"
-/** Hour strings */
+/* Hour strings */
char *hourname[] = {
"12am", "1am", "2am", "3am", "4am", "5am", "6am",
"7am", "8am", "9am", "10am", "11am", "12pm",
@@ -16,7 +26,6 @@ char *hourname[] = {
};
/*
- * \brief display and edit date/time
* The display_icaltimetype_as_webform() and icaltime_from_webform() functions
* handle the display and editing of date/time properties in web pages. The
* first one converts an icaltimetype into valid HTML markup -- a series of form
@@ -27,34 +36,27 @@ char *hourname[] = {
* property (for example, a start and end time) by ensuring the field names are
* unique within the form.
*
- * \todo NOTE: These functions assume that the icaltimetype being edited is in UTC, and
+ * NOTE: These functions assume that the icaltimetype being edited is in UTC, and
* will convert to/from local time for editing. "local" in this case is assumed
* to be the time zone in which the WebCit server is running. A future improvement
* might be to allow the user to specify his/her timezone.
- * \param t the time we want to parse
- * \param prefix ???? \todo
*/
-
-void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix) {
+void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix, int date_only) {
+ wcsession *WCC = WC;
int i;
time_t now;
struct tm tm_now;
- int this_year;
time_t tt;
struct tm tm;
- const int span = 10;
int all_day_event = 0;
- time_t monthselect_time;
- struct tm monthselect_tm;
- char monthselect_str[32];
int time_format;
+ char timebuf[32];
time_format = get_time_format_cached ();
now = time(NULL);
localtime_r(&now, &tm_now);
- this_year = tm_now.tm_year + 1900;
if (t == NULL) return;
if (t->is_date) all_day_event = 1;
@@ -66,130 +68,115 @@ void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix) {
localtime_r(&tt, &tm);
}
- wprintf(_("Month: "));
- wprintf("\n");
-
- wprintf(_("Day: "));
- wprintf("\n");
-
- wprintf(_("Year: "));
- wprintf("