- t_age = time (NULL) - mktime (&bday_tm);
- age_tm = gmtime (&t_age);
- age = age_tm->tm_year - 70;
+ if (mktime (&bday_tm) > current_date) {
+ age = (current_date_tm->tm_year + 1900) - bdate->year - 1;
+ } else {
+ age = (current_date_tm->tm_year + 1900) - bdate->year;
+ }
{
struct tm current_bday_tm, next_bday_tm;
struct tm *current_date_tm;
{
struct tm current_bday_tm, next_bday_tm;
struct tm *current_date_tm;
current_bday_tm.tm_mday = bdate->day;
current_bday_tm.tm_mon = bdate->month - 1;
current_bday_tm.tm_year = current_date_tm->tm_year;
current_bday_tm.tm_mday = bdate->day;
current_bday_tm.tm_mon = bdate->month - 1;
current_bday_tm.tm_year = current_date_tm->tm_year;
next_bday_tm.tm_sec = 0;
next_bday_tm.tm_min = 0;
next_bday_tm.tm_hour = 0;
next_bday_tm.tm_mday = bdate->day;
next_bday_tm.tm_mon = bdate->month - 1;
next_bday_tm.tm_year = current_date_tm->tm_year + 1;
next_bday_tm.tm_sec = 0;
next_bday_tm.tm_min = 0;
next_bday_tm.tm_hour = 0;
next_bday_tm.tm_mday = bdate->day;
next_bday_tm.tm_mon = bdate->month - 1;
next_bday_tm.tm_year = current_date_tm->tm_year + 1;
g_return_val_if_fail (priv, NULL);
text_font = get_text_font_by_name ("SmallSystemFont");
text_color = get_text_color_by_name ("SecondaryTextColor");
g_return_val_if_fail (priv, NULL);
text_font = get_text_font_by_name ("SmallSystemFont");
text_color = get_text_color_by_name ("SecondaryTextColor");
store = gtk_list_store_new(NUM_COLS,
GDK_TYPE_PIXBUF, /* COLUMN_AVATAR */
G_TYPE_STRING, /* COLUMN_DISPLAY */
store = gtk_list_store_new(NUM_COLS,
GDK_TYPE_PIXBUF, /* COLUMN_AVATAR */
G_TYPE_STRING, /* COLUMN_DISPLAY */
birthday_tm.tm_year = bdate->year - 1900;
strftime (birthday_text, 11, _HL("wdgt_va_date"), &birthday_tm);
birthday_tm.tm_year = bdate->year - 1900;
strftime (birthday_text, 11, _HL("wdgt_va_date"), &birthday_tm);
next_birthday_text = g_strdup_printf(ngettext ("next birthday in %d day", "next birthday in %d days", next_birthday), next_birthday);
display_column = g_strdup_printf("%s <span font_desc=\"%s\" foreground=\"%s\"><sup>(%d)</sup>\n%s, %s</span>",
fullname, text_font, text_color, age, birthday_text, next_birthday_text);
next_birthday_text = g_strdup_printf(ngettext ("next birthday in %d day", "next birthday in %d days", next_birthday), next_birthday);
display_column = g_strdup_printf("%s <span font_desc=\"%s\" foreground=\"%s\"><sup>(%d)</sup>\n%s, %s</span>",
fullname, text_font, text_color, age, birthday_text, next_birthday_text);