Index: csv-format.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/save-calendar/csv-format.c,v
retrieving revision 1.3
diff -u -r1.3 csv-format.c
--- csv-format.c	4 Jan 2005 11:52:21 -0000	1.3
+++ csv-format.c	28 Feb 2005 15:26:01 -0000
@@ -155,25 +155,37 @@
 static GString *
 add_time_to_csv (GString *line, icaltimetype *time, CsvConfig *config)
 {
-	/*
-	 * Perhaps we should check for quotes, delimiter and newlines in the
-	 * resulting string: The translators can put it there!
-	 *
-	 * Or perhaps we shouldn't make this translatable?
-	 * Or perhaps there is a library-function to do this?
-	 */
 
 	if (time) {
-		g_string_append_printf (line, _("%s%d/%s%d/%s%d %s%d:%s%d:%s%d"), 
-					(time->month < 10)?"0":"", time->month, 
-					(time->day < 10)?"0":"", time->day, 
-					(time->year < 10)?"0":"", time->year, 
-					(time->hour < 10)?"0":"", time->hour, 
-					(time->minute < 10)?"0":"", time->minute, 
-					(time->second < 10)?"0":"", time->second);
+		gboolean needquotes = FALSE;
+		struct tm mytm;
+		GDate *date = g_date_new_dmy (time->day, time->month, time->year);
+		char *str = (char*) malloc (sizeof (char) * 200);
+		
+		g_date_to_struct_tm (date, &mytm);
+		mytm.tm_hour = time->hour;
+		mytm.tm_min = time->minute;
+		mytm.tm_sec = time->second;
+		
+		strftime (str, 200, "%F %T", &mytm);
+		
+		needquotes = string_needsquotes (str, config);
+		
+		if (needquotes)
+			line = g_string_append (line, config->quote);	
+		
+		line = g_string_append (line, str);
+		
+		if (needquotes)
+			line = g_string_append (line, config->quote);
+	
+		g_date_free (date);	
+		free (str);
+		
 	}
 
 	line = g_string_append (line, config->delimiter);
+
 	return line;
 }
 
@@ -352,7 +364,7 @@
 
 	result = gnome_vfs_open_uri (&handle, uri, GNOME_VFS_OPEN_READ);
 	if (result == GNOME_VFS_OK)
-		doit = e_error_run(gtk_widget_get_toplevel (GTK_WIDGET (target->selector)),
+		doit = e_error_run(GTK_WINDOW(gtk_widget_get_toplevel (GTK_WIDGET (target->selector))),
 			 E_ERROR_ASK_FILE_EXISTS_OVERWRITE, dest_uri, NULL) == GTK_RESPONSE_OK;
 
 	if (doit) {
@@ -367,14 +379,18 @@
 
 		if (config->header) {
 			line = g_string_new ("");
-			g_string_append_printf (line, _("Uid%sSummary%sDescription List%sCategories List%s"
+				g_string_append_printf (line, "Uid%sSummary%sDescription List%sCategories List%s"
 							"Comment List%sCompleted%sCreated%sContact List%s"
 							"Start%sEnd%sDue%sPercent Done%sPriority%sUrl%s"
-							"Attendees List%sLocation%sModified%s"),
-						config->delimiter, config->delimiter, config->delimiter, config->delimiter, 
-						config->delimiter, config->delimiter, config->delimiter, config->delimiter, 
-						config->delimiter, config->delimiter, config->delimiter, config->delimiter, 
-						config->delimiter, config->delimiter, config->delimiter, config->delimiter, 
+							"Attendees List%sLocation%sModified%s",
+						config->delimiter, config->delimiter, 
+						config->delimiter, config->delimiter, 
+						config->delimiter, config->delimiter, 
+						config->delimiter, config->delimiter, 
+						config->delimiter, config->delimiter, 
+						config->delimiter, config->delimiter, 
+						config->delimiter, config->delimiter, 
+						config->delimiter, config->delimiter, 
 						config->newline);
 
 			gnome_vfs_write (handle, line->str, line->len, NULL);
