@@ -4,24 +4,67 @@ import QtQuick.Layouts 1.3
44import Qt.labs.calendar 1.0
55import de.skycoder42.QtMvvm.Quick 1.1
66
7+ /*! @brief A edit view to edit dates by using a calendar
8+ *
9+ * @extends QtQuick.ListView
10+ *
11+ * You can use this edit if you want to let the user select a date. You can use the properties
12+ * to control wich tumblers are shown and which format they use.
13+ *
14+ * @note This edit currently uses Qt.labs.calendar - an experimental module, and thus might
15+ * not always function perfectly or break after Qt updates
16+ */
717ListView {
818 id: _calenderList
919
20+ /* ! @brief The smallest possible date the user can select
21+ *
22+ * @default{`new Date(1970, 0, 1)`}
23+ *
24+ * @note Only the date-componente of the date object is used.
25+ *
26+ * @accessors{
27+ * @memberAc{firstDate}
28+ * @notifyAc{firstDateChanged()}
29+ * }
30+ */
1031 property date firstDate: new Date (1970 , 0 , 1 )
32+ /* ! @brief The highest possible date the user can select
33+ *
34+ * @default{`new Date(9999, 11, 31)`}
35+ *
36+ * @note Only the date-componente of the date object is used.
37+ *
38+ * @accessors{
39+ * @memberAc{lastDate}
40+ * @notifyAc{lastDateChanged()}
41+ * }
42+ */
1143 property date lastDate: new Date (9999 , 11 , 31 )
12- property date date: today ();
13-
14- function today () {
15- var cDate = new Date ();
16- cDate .setHours (0 , 0 , 0 , 0 , 0 );
17- return cDate;
18- }
44+ /* ! @brief The date currently displayed and edited
45+ *
46+ * @default{`new Date()`}
47+ *
48+ * @note Only the date-componente of the date object is used.
49+ *
50+ * @accessors{
51+ * @memberAc{date}
52+ * @notifyAc{dateChanged()}
53+ * }
54+ */
55+ property date date: _p .today ();
1956
2057 QtObject {
2158 id: _p
2259
2360 property bool _skipNextFocus: false
2461
62+ function today () {
63+ var cDate = new Date ();
64+ cDate .setHours (0 , 0 , 0 , 0 , 0 );
65+ return cDate;
66+ }
67+
2568 function focusDate () {
2669 if (_skipNextFocus)
2770 _skipNextFocus = false ;
0 commit comments