6 // Year item dimensions
7 property int yearWidth: (width-2*spacing)*0.4
8 property int yearHeight: height
9 // Month item dimensions
10 property int monthWidth: (width-2*spacing)*0.3
11 property int monthHeight: height
12 // Day item dimensions
13 property int dayWidth: (width-2*spacing)*0.3
14 property int dayHeight: height
16 property string fontName: 'Helvetica'
17 property int fontSize: 22
18 property color fontColor: "#666666"
19 // Spacing between items
20 property int spacing: 8
22 property Component itemBackground: Component {
24 border { top: 8; bottom: 8; left: 8; right: 8 }
25 source: theme_manager.theme.datepicker.button
28 property Component itemBackgroundPressed: Component {
30 border { top: 8; bottom: 8; left: 8; right: 8 }
31 source: theme_manager.theme.datepicker.button_pressed
38 Component.onCompleted: {
44 width: container.dayWidth
45 height: container.dayHeight
47 fontColor: container.fontColor
48 fontName: container.fontName
49 fontSize: container.fontSize
51 bgPressed: itemBackgroundPressed
52 opacity: (index+1 < days.start || index+1 > days.end) ? 0.5 : 1.0
59 width: container.monthWidth
60 height: container.monthHeight
62 fontColor: container.fontColor
63 fontName: container.fontName
64 fontSize: container.fontSize
66 bgPressed: itemBackgroundPressed
74 width: container.yearWidth
75 height: container.yearHeight
77 fontColor: container.fontColor
78 fontName: container.fontName
79 fontSize: container.fontSize
81 bgPressed: itemBackgroundPressed
88 spacing: container.spacing
92 width: container.dayWidth
93 height: container.dayHeight
99 if (day.index+1 < days.start) day.index = days.start-1;
100 else if (day.index+1 > days.end ) day.index = days.end-1;
103 datePicker.mDay = day.index + 1;
104 datePicker.mMonth = month.index + 1;
105 datePicker.mYear = year.index + 1900;
111 width: container.monthWidth
112 height: container.monthHeight
114 delegate: monthDelegate
119 datePicker.mDay = day.index + 1;
120 datePicker.mMonth = month.index + 1;
121 datePicker.mYear = year.index + 1900;
127 width: container.yearWidth
128 height: container.yearHeight
130 delegate: yearDelegate
135 datePicker.mDay = day.index + 1;
136 datePicker.mMonth = month.index + 1;
137 datePicker.mYear = year.index + 1900;
147 property int start: 1
150 Component.onCompleted: {
152 day.index = screen.curDay - 1
153 end = LC.calDays(month.index+1,year.index+1900);
157 var howmanydays = LC.calDays(month.index+1,year.index+1900);
160 if (day.index+1 < days.start) day.index = days.start-1;
161 else if (day.index+1 > days.end ) day.index = days.end-1;
165 for(var j=1;j<=31;j++){
167 append({number:"0"+j})
174 day.index = screen.curDay-1;
180 Component.onCompleted: {
181 for(var j=1;j<=12;j++){
183 append({number:"0"+j})
187 month.index = screen.curMonth - 1
191 month.index = screen.curMonth - 1;
197 Component.onCompleted: {
198 for(var i=1900;i<2099;i++){
201 year.index = screen.curYear - 1900
205 year.index = screen.curYear - 1900
209 function day_reset(){
210 datePicker.mDay = screen.curDay
214 function month_reset(){
215 datePicker.mMonth = screen.curMonth
219 function year_reset(){
220 datePicker.mYear = screen.curYear