mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 798611 - Date changing when changing timezone by one hour
When getting a date from the date editor anywhere in the program set the time to neutral time instead of the beginning of the day unless get_date_internal is called with GNC_DATE_EDIT_SHOW_TIME in which case the user-provided time is used.
This commit is contained in:
parent
a807d3e6b7
commit
c81aedddde
@ -296,7 +296,7 @@ gnc_date_edit_popup (GNCDateEdit *gde)
|
|||||||
if (!date_was_valid)
|
if (!date_was_valid)
|
||||||
{
|
{
|
||||||
/* No valid date. Hacky workaround: Instead of crashing we randomly choose today's date. */
|
/* No valid date. Hacky workaround: Instead of crashing we randomly choose today's date. */
|
||||||
gnc_tm_get_today_start(&mtm);
|
gnc_tm_get_today_neutral(&mtm);
|
||||||
}
|
}
|
||||||
|
|
||||||
mtm.tm_mon--;
|
mtm.tm_mon--;
|
||||||
@ -307,7 +307,7 @@ gnc_date_edit_popup (GNCDateEdit *gde)
|
|||||||
if (mtm.tm_year >= 1900)
|
if (mtm.tm_year >= 1900)
|
||||||
mtm.tm_year -= 1900;
|
mtm.tm_year -= 1900;
|
||||||
|
|
||||||
gnc_tm_set_day_start(&mtm);
|
gnc_tm_set_day_neutral(&mtm);
|
||||||
|
|
||||||
/* Set the calendar. */
|
/* Set the calendar. */
|
||||||
gtk_calendar_select_day (GTK_CALENDAR (gde->calendar), 1);
|
gtk_calendar_select_day (GTK_CALENDAR (gde->calendar), 1);
|
||||||
@ -1061,7 +1061,7 @@ gnc_date_edit_get_date_internal (GNCDateEdit *gde)
|
|||||||
revert to today's date. Alternatively we can return some value that
|
revert to today's date. Alternatively we can return some value that
|
||||||
signals that we don't get a valid date, but all callers of this
|
signals that we don't get a valid date, but all callers of this
|
||||||
function will have to check this. Alas, I'm too lazy to do this here. */
|
function will have to check this. Alas, I'm too lazy to do this here. */
|
||||||
gnc_tm_get_today_start(&tm);
|
gnc_tm_get_today_neutral(&tm);
|
||||||
}
|
}
|
||||||
|
|
||||||
tm.tm_mon--;
|
tm.tm_mon--;
|
||||||
@ -1109,7 +1109,7 @@ gnc_date_edit_get_date_internal (GNCDateEdit *gde)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gnc_tm_set_day_start(&tm);
|
gnc_tm_set_day_neutral(&tm);
|
||||||
}
|
}
|
||||||
|
|
||||||
tm.tm_isdst = -1;
|
tm.tm_isdst = -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user