2
import Ubuntu.Components 0.1
3
import Ubuntu.Components.Popups 0.1
4
import Ubuntu.Components.ListItems 0.1 as ListItem
6
import "dataService.js" as DataService
10
property var defaultDate;
20
ListItem.Header { text: i18n.tr("Create event") }
22
highlightWhenPressed: false
25
placeholderText: i18n.tr("Add event name")
49
height: dateLabel.height
52
text: Qt.formatDateTime(defaultDate, "ddd, d MMMM yyyy");
64
height: startTime.height
68
highlightWhenPressed: false
69
anchors.left: timeContainer.left
73
text: Qt.formatDateTime(defaultDate,"hh")
83
highlightWhenPressed: false
84
anchors.right: timeContainer.right
88
text: Qt.formatDateTime(defaultDate,"hh")
99
ListItem.Header { text: i18n.tr("Location") }
101
highlightWhenPressed: false
104
placeholderText: i18n.tr("Add Location")
112
ListItem.Header { text: i18n.tr("People") }
114
highlightWhenPressed: false
117
placeholderText: i18n.tr("Invite People")
125
ListItem.SingleControl {
126
highlightWhenPressed: false
128
text: i18n.tr("Save")
135
var startDate = new Date(defaultDate)
137
startDate.setHours(startTimeEdit.text)
138
print(startTimeEdit.text)
140
var endDate = new Date(defaultDate)
142
endDate.setHours(endTimeEdit.text)
143
print(endTimeEdit.text)
146
title: titleEdit.text,
148
startTime: startDate.getTime(),
149
endTime: endDate.getTime()
152
DataService.addEvent(event)
154
PopupUtils.close(popover);