Skip to content

Commit

Permalink
SX - recalculate all occurrences of all SX if the calendar is updated…
Browse files Browse the repository at this point in the history
… to start on another month

This potentially fixes the jumping dates issues as mentioned in bug 644898
  • Loading branch information
gjanssens committed Aug 24, 2016
1 parent 80890b6 commit a4f96d0
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/gnome-utils/gnc-dense-cal.c
Expand Up @@ -1738,17 +1738,25 @@ gdc_add_tag_markings(GncDenseCal *cal, guint tag)
}
if (g_date_valid(dates[0]))
{
if (g_date_get_julian(dates[0]) < g_date_get_julian(calDate))
{
_gnc_dense_cal_set_month(cal, g_date_get_month(dates[0]), FALSE);
_gnc_dense_cal_set_year(cal, g_date_get_year(dates[0]), FALSE);
}
if (g_date_get_julian(dates[0]) < g_date_get_julian(calDate))
{
/* Oops, first marking is earlier than months displayed.
* Choose new first month and recalculate all markings for all
* tags. Their offsets are all wrong with the newly added month(s).
*/
_gnc_dense_cal_set_month(cal, g_date_get_month(dates[0]), FALSE);
_gnc_dense_cal_set_year(cal, g_date_get_year(dates[0]), FALSE);

gdc_remove_markings (cal);
gdc_add_markings (cal);
}
else
gdc_mark_add(cal, tag, name, info, num_marks, dates);
}
else
{
g_warning("Bad date, skipped.");
g_warning("Bad date, skipped.");
}
gdc_mark_add(cal, tag, name, info, num_marks, dates);

for (idx = 0; idx < num_marks; idx++)
{
Expand Down

0 comments on commit a4f96d0

Please sign in to comment.