Commit a6a4e86c authored by Milan Crha's avatar Milan Crha
Browse files

Bug 783682 - Misleading start date set for Memos created inline in Calendar view

parent f733f3ad
......@@ -1440,7 +1440,9 @@ cal_model_create_component_from_values_thread (EAlertSinkThreadJobData *job_data
time_t tt = ccd->model->priv->get_default_time (ccd->model, ccd->model->priv->get_default_time_user_data);
if (tt > 0) {
struct icaltimetype itt = icaltime_from_timet_with_zone (tt, FALSE, e_cal_model_get_timezone (ccd->model));
/* Store Memo DTSTART as date, not as date-time */
struct icaltimetype itt = icaltime_from_timet_with_zone (tt,
icalcomponent_isa (comp_data->icalcomp) == ICAL_VJOURNAL_COMPONENT, e_cal_model_get_timezone (ccd->model));
icalproperty *prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DTSTART_PROPERTY);
if (prop) {
......
......@@ -1054,12 +1054,24 @@ cal_shell_content_get_default_time (ECalModel *model,
gpointer user_data)
{
ECalShellContent *cal_shell_content = user_data;
icaltimezone *zone;
g_return_val_if_fail (model != NULL, 0);
g_return_val_if_fail (E_IS_CAL_SHELL_CONTENT (cal_shell_content), 0);
return cal_comp_gdate_to_timet (&cal_shell_content->priv->view_start,
e_cal_model_get_timezone (model));
if (e_cal_shell_content_get_current_view_id (cal_shell_content) != E_CAL_VIEW_KIND_LIST) {
ECalendarView *cal_view;
time_t selected_start = (time_t) 0, selected_end = (time_t) 0;
cal_view = e_cal_shell_content_get_current_calendar_view (cal_shell_content);
if (cal_view && e_calendar_view_get_selected_time_range (cal_view, &selected_start, &selected_end))
return selected_start;
}
zone = e_cal_model_get_timezone (model);
return icaltime_as_timet_with_zone (icaltime_current_time_with_zone (zone), zone);
}
static void
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment