5import org.mauikit.controls as Maui
6import org.mauikit.calendar as Kalendar
45 readonly property date startDate : new Date()
50 property int selectedMonth : selectedDate.getUTCMonth()
55 property int selectedYear: selectedDate.getUTCFullYear()
60 property int selectedDay : selectedDate.getDate()
65 property date selectedDate : startDate
71 signal accepted(var date)
81 leftContent: Maui.ToolActions
87 text: control.selectedDay
88 checked: _swipeView.currentIndex === 0
89 onTriggered: _swipeView.currentIndex = 0
94 text: Qt.locale().standaloneMonthName(control.selectedMonth)
95 checked: _swipeView.currentIndex === 1
96 onTriggered: _swipeView.currentIndex = 1
102 text: control.selectedYear
103 checked: _swipeView.currentIndex === 2
104 onTriggered: _swipeView.currentIndex = 2
111 onClicked: control.accepted(control.selectedDate)
115 contentItem: SwipeView
124 month: control.selectedMonth+1
125 year: control.selectedYear
127 onDateClicked: (date) =>
129 control.updateSelectedDate(date.getDate(), control.selectedMonth, control.selectedYear)
136 selectedMonth: control.selectedMonth
137 onMonthSelected: (month) => control.updateSelectedDate(control.selectedDay, month, control.selectedYear)
143 selectedYear: control.selectedYear
144 onYearSelected: (year) => control.updateSelectedDate(control.selectedDay, control.selectedMonth, year)
151 function updateSelectedDate(day, month, year)
153 control.selectedDay = day
154 control.selectedMonth = month
155 control.selectedYear = year
157 console.log(
"CREATING A NEW DATE WITH", day, month, year)
158 control.selectedDate =
new Date(year, month, day)
159 _swipeView.incrementCurrentIndex()