[gnome-calendar/date-selector] date-selector: limit number of digits of entries
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/date-selector] date-selector: limit number of digits of entries
- Date: Sun, 21 Dec 2014 14:33:05 +0000 (UTC)
commit d422342262f1891f32a099e03cb668cbf38c1470
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sun Dec 21 11:47:08 2014 -0200
date-selector: limit number of digits of entries
src/gcal-date-selector.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/gcal-date-selector.c b/src/gcal-date-selector.c
index f5a31eb..e1edb83 100644
--- a/src/gcal-date-selector.c
+++ b/src/gcal-date-selector.c
@@ -111,22 +111,22 @@ set_date (GcalDateSelector *selector,
/* set date entries' text */
/* day entry */
- label = g_strdup_printf ("%d", day);
+ label = g_strdup_printf ("%.2d", day);
gtk_entry_set_text (GTK_ENTRY (priv->entries[DAY]), label);
g_free (label);
/* month entry */
- label = g_strdup_printf ("%d", month + 1);
+ label = g_strdup_printf ("%.2d", month + 1);
gtk_entry_set_text (GTK_ENTRY (priv->entries[MONTH]), label);
g_free (label);
/* year entry */
if (priv->have_long_year)
- label = g_strdup_printf ("%d", year);
+ label = g_strdup_printf ("%.4d", year);
else
- label = g_strdup_printf ("%d", year % 100);
+ label = g_strdup_printf ("%.2d", year % 100);
gtk_entry_set_text (GTK_ENTRY (priv->entries[YEAR]), label);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]