about summary refs log tree commit diff
path: root/third_party/notmuch/dottime.patch
blob: c9e0159ca242ada803c58ca960ebae3fa59008c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
diff --git a/notmuch-time.c b/notmuch-time.c
index 2734b36a..b1ec4bdc 100644
--- a/notmuch-time.c
+++ b/notmuch-time.c
@@ -50,8 +50,8 @@ notmuch_time_relative_date (const void *ctx, time_t then)
     time_t delta;
     char *result;
 
-    localtime_r (&now, &tm_now);
-    localtime_r (&then, &tm_then);
+    gmtime_r (&now, &tm_now);
+    gmtime_r (&then, &tm_then);
 
     result = talloc_zero_size (ctx, RELATIVE_DATE_MAX);
     if (result == NULL)
@@ -79,16 +79,16 @@ notmuch_time_relative_date (const void *ctx, time_t then)
 	    delta < DAY)
 	{
 	    strftime (result, RELATIVE_DATE_MAX,
-		      "Today %R", &tm_then); /* Today 12:30 */
+		      "Today %k·%M", &tm_then); /* Today 12·30 */
 	    return result;
 	} else if ((tm_now.tm_wday + 7 - tm_then.tm_wday) % 7 == 1) {
 	    strftime (result, RELATIVE_DATE_MAX,
-		      "Yest. %R", &tm_then); /* Yest. 12:30 */
+		      "Yest. %k·%M", &tm_then); /* Yest. 12·30 */
 	    return result;
 	} else {
 	    if (tm_then.tm_wday != tm_now.tm_wday) {
 		strftime (result, RELATIVE_DATE_MAX,
-			  "%a. %R", &tm_then); /* Mon. 12:30 */
+			  "%a. %k·%M", &tm_then); /* Mon. 12·30 */
 		return result;
 	    }
 	}
diff --git a/util/gmime-extra.c b/util/gmime-extra.c
index d1bb1d47..9df5a454 100644
--- a/util/gmime-extra.c
+++ b/util/gmime-extra.c
@@ -124,7 +124,10 @@ g_mime_message_get_date_string (void *ctx, GMimeMessage *message)
 {
     GDateTime* parsed_date = g_mime_message_get_date (message);
     if (parsed_date) {
-	char *date = g_mime_utils_header_format_date (parsed_date);
+	char *date = g_date_time_format(
+		parsed_date,
+		"%a, %d %b %Y %H·%M%z"
+	);
 	return g_string_talloc_strdup (ctx, date);
     } else {
 	return talloc_strdup(ctx, "Thu, 01 Jan 1970 00:00:00 +0000");
diff --git a/util/gmime-extra.h b/util/gmime-extra.h
index b0c8d3d8..40f748f8 100644
--- a/util/gmime-extra.h
+++ b/util/gmime-extra.h
@@ -1,5 +1,7 @@
 #ifndef _GMIME_EXTRA_H
 #define _GMIME_EXTRA_H
+#include <glib.h>
+#include <glib/gprintf.h>
 #include <gmime/gmime.h>
 #include <talloc.h>