2
import Ubuntu.Components.ListItems 1.0 as ListItem
3
import Ubuntu.Components.Themes.Ambiance 1.0
4
import Ubuntu.Components.Pickers 1.0
8
property alias header: listHeader.text
10
property date dateTime;
11
property bool showTimePicker;
13
function clearFocus() {
14
dateInput.focus = false;
15
timeInput.focus = false;
18
function openDatePicker (element, caller, callerProperty, mode) {
19
element.highlighted = true;
20
var picker = PickerPanel.openDatePicker(caller, callerProperty, mode);
22
picker.closed.connect(function () {
23
element.highlighted = false;
28
dateInput.text = dateTime.toLocaleDateString();
29
timeInput.text = Qt.formatTime(dateTime);
43
height: dateInput.height
47
objectName: "dateInput"
50
anchors.left: parent.left
51
width: !showTimePicker ? parent.width : 4 * parent.width / 5
55
onClicked: openDatePicker(dateInput, dateTimeInput, "dateTime", "Years|Months|Days")
61
objectName: "timeInput"
64
anchors.right: parent.right
65
width: parent.width / 5
66
visible: showTimePicker
67
horizontalAlignment: Text.AlignRight
71
onClicked: openDatePicker(timeInput, dateTimeInput, "dateTime", "Hours|Minutes")