summaryrefslogtreecommitdiff
path: root/stickynotes/stickynotes.c
diff options
context:
space:
mode:
Diffstat (limited to 'stickynotes/stickynotes.c')
-rw-r--r--stickynotes/stickynotes.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/stickynotes/stickynotes.c b/stickynotes/stickynotes.c
index 4c7ce215..0b163dc0 100644
--- a/stickynotes/stickynotes.c
+++ b/stickynotes/stickynotes.c
@@ -399,17 +399,21 @@ void stickynote_set_title(StickyNote *note, const gchar *title)
{
/* If title is NULL, use the current date as the title. */
if (!title) {
- gchar *date_title, *tmp;
- gchar *date_format = g_settings_get_string (stickynotes->settings, "date-format");
+ GDateTime *now;
+ gchar *date_title;
+ gchar *date_format;
+
+ date_format = g_settings_get_string (stickynotes->settings, "date-format");
if (!date_format)
date_format = g_strdup ("%x");
- tmp = get_current_date (date_format);
- date_title = g_locale_to_utf8 (tmp, -1, NULL, NULL, NULL);
+
+ now = g_date_time_new_now_local ();
+ date_title = g_date_time_format (now, date_format);
gtk_window_set_title(GTK_WINDOW(note->w_window), date_title);
gtk_label_set_text(GTK_LABEL (note->w_title), date_title);
- g_free (tmp);
+ g_date_time_unref (now);
g_free(date_title);
g_free(date_format);
}