summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Lundblad <ml@update.uu.se>2022-02-27 21:16:37 +0100
committerMarcus Lundblad <ml@dfupdate.se>2022-02-28 22:55:56 +0100
commit11820c639100f65c8b19fce7551fcbe899bb7dad (patch)
tree2c27eb0985f72508c353163841fe073cf6d7f19c
parent35fe8f42602d66f0de776419e328c21cff2554ef (diff)
downloadgnome-maps-wip/mlundblad/transit-update-calendar-date.tar.gz
transitOptionsPanel: Select day when setting date buttonwip/mlundblad/transit-update-calendar-date
Also select the day when updating the date button (e.g. when selecting "Leave by" or "Arrive by". Otherwise the calendar would have the last selected day selected (or the day the instance was created, that is when Maps was started).
-rw-r--r--src/transitOptionsPanel.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/transitOptionsPanel.js b/src/transitOptionsPanel.js
index 6c23a3ee..cdadc84c 100644
--- a/src/transitOptionsPanel.js
+++ b/src/transitOptionsPanel.js
@@ -131,7 +131,15 @@ var TransitOptionsPanel = GObject.registerClass({
}
}
+ /**
+ * Update the date select button with given date, and select the
+ * corresponding day in the calendar shown when clicking the button.
+ */
_updateTransitDateButton(date) {
+ let calendar = this._transitDateButton.popover.get_child();
+
+ calendar.select_month(date.get_month(), date.get_year());
+ calendar.select_day(date.get_day_of_month());
this._transitDateButton.label =
/*
* Translators: this is a format string giving the equivalent to