@@ -4,24 +4,67 @@ import QtQuick.Layouts 1.3
4
4
import Qt.labs.calendar 1.0
5
5
import de.skycoder42.QtMvvm.Quick 1.1
6
6
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
+ */
7
17
ListView {
8
18
id: _calenderList
9
19
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
+ */
10
31
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
+ */
11
43
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 ();
19
56
20
57
QtObject {
21
58
id: _p
22
59
23
60
property bool _skipNextFocus: false
24
61
62
+ function today () {
63
+ var cDate = new Date ();
64
+ cDate .setHours (0 , 0 , 0 , 0 , 0 );
65
+ return cDate;
66
+ }
67
+
25
68
function focusDate () {
26
69
if (_skipNextFocus)
27
70
_skipNextFocus = false ;
0 commit comments