diff options
author | Ted Gould <ted@gould.cx> | 2011-04-05 15:10:50 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-04-05 15:10:50 -0500 |
commit | 9744a2f892fb78f74e9c942197ca98309a9e2759 (patch) | |
tree | 3796956fe11b577fddbcda3d9ee9c673a0974bdf /src/datetime-service.c | |
parent | 3a5ab9e661b7d7438c6c494b271c6be86a3703e8 (diff) | |
download | ayatana-indicator-datetime-9744a2f892fb78f74e9c942197ca98309a9e2759.tar.gz ayatana-indicator-datetime-9744a2f892fb78f74e9c942197ca98309a9e2759.tar.bz2 ayatana-indicator-datetime-9744a2f892fb78f74e9c942197ca98309a9e2759.zip |
Pull the full day into a boolean and reformat
Diffstat (limited to 'src/datetime-service.c')
-rw-r--r-- | src/datetime-service.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c index 66a6cdb..c72b061 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -859,25 +859,33 @@ update_appointment_menu_items (gpointer user_data) g_debug("Summary: %s", summary); g_free (summary); + gboolean full_day = FALSE; + if (vtype == E_CAL_COMPONENT_EVENT) { + time_t start = ci->start; + if (time_add_day(start, 1) == ci->end) { + full_day = TRUE; + } + } + // Due text - if (time_add_day(ci->start, 1) == ci->end) { + if (full_day) { /* TRANSLATORS: This is a strftime string for the day for full day events in the menu. It should most likely be either '%A' for a full text day (Wednesday) or '%a' for a shortened one (Wed). You should only need to change for '%a' in the case of langauges with very long day names. */ strftime(right, 20, _("%A"), due); } else { - if (apt_output == SETTINGS_TIME_12_HOUR) { - if ((mday == dmday) && (mon == dmon) && (year == dyear)) - strftime(right, 20, _(DEFAULT_TIME_12_FORMAT), due); - else - strftime(right, 20, _(DEFAULT_TIME_12_FORMAT_WITH_DAY), due); - } else if (apt_output == SETTINGS_TIME_24_HOUR) { - if ((mday == dmday) && (mon == dmon) && (year == dyear)) - strftime(right, 20, _(DEFAULT_TIME_24_FORMAT), due); - else - strftime(right, 20, _(DEFAULT_TIME_24_FORMAT_WITH_DAY), due); - } + if (apt_output == SETTINGS_TIME_12_HOUR) { + if ((mday == dmday) && (mon == dmon) && (year == dyear)) + strftime(right, 20, _(DEFAULT_TIME_12_FORMAT), due); + else + strftime(right, 20, _(DEFAULT_TIME_12_FORMAT_WITH_DAY), due); + } else if (apt_output == SETTINGS_TIME_24_HOUR) { + if ((mday == dmday) && (mon == dmon) && (year == dyear)) + strftime(right, 20, _(DEFAULT_TIME_24_FORMAT), due); + else + strftime(right, 20, _(DEFAULT_TIME_24_FORMAT_WITH_DAY), due); + } } g_debug("Appointment time: %s, for date %s", right, asctime(due)); dbusmenu_menuitem_property_set (item, APPOINTMENT_MENUITEM_PROP_RIGHT, right); |