@@ -505,25 +505,38 @@ Item {
505 id: calendarMenu
505 id: calendarMenu
507 Menus.CalendarMenu {
507 Menus.CalendarMenu {
508 objectName: "calendarMenu"
509 objectName: "calendarMenu"
509 focus: true
510 focus: true
511 property QtObject menuData: null
512 property QtObject menuData: null
512 property var menuModel: menuFactory.menuModel
513 property var menuModel: menuFactory.menuModel
513 property var actionState: menuData && menuData.actionState || null
514 property var actionState: menuData && menuData.actionState || null
514− property int calendarDay: getExtendedProperty(actionState, "calendar-day", 0) * 1000
515+ property real calendarDay: getExtendedProperty(actionState, "calendar-day", 0)
515 property int menuIndex: -1
516 property int menuIndex: -1
517 showWeekNumbers: getExtendedProperty(actionState, "show-week-numbers", false)
518 showWeekNumbers: getExtendedProperty(actionState, "show-week-numbers", false)
518 eventDays: getExtendedProperty(actionState, "appointment-days", [])
519 eventDays: getExtendedProperty(actionState, "appointment-days", [])
520− Binding on currentDate {
521+ onCalendarDayChanged: {
521− when: calendarDay > 0
522+ if (calendarDay > 0) {
523+ // This would trigger a selectionDateChanged signal, thus
524+ // we've to avoid that the subsequent model activation
525+ // would cause an infinite loop
526+ modelUpdateConnections.enabled = false
522− value: new Date(calendarDay)
527+ currentDate = new Date(calendarDay * 1000)
528+ modelUpdateConnections.enabled = true
533+ id: modelUpdateConnections
534+ property bool enabled: true
535+ target: (enabled && calendarItem.visible) ? calendarItem : null
525− onSelectedDateChanged: {
537+ onSelectedDateChanged: {
526− menuModel.activate(menuIndex, selectedDate.getTime() / 1000 | 0)
538+ menuModel.activate(menuIndex, selectedDate.getTime() / 1000 | 0)