Merge lp:~yohanboniface/ubuntu-calendar-app/AgendaView into lp:ubuntu-calendar-app
- AgendaView
- Merge into trunk
Status: | Rejected | ||||
---|---|---|---|---|---|
Rejected by: | Mihir Soni | ||||
Proposed branch: | lp:~yohanboniface/ubuntu-calendar-app/AgendaView | ||||
Merge into: | lp:ubuntu-calendar-app | ||||
Diff against target: |
161 lines (+135/-0) 3 files modified
AgendaView.qml (+107/-0) calendar.qml (+14/-0) dateExt.js (+14/-0) |
||||
To merge this branch: | bzr merge lp:~yohanboniface/ubuntu-calendar-app/AgendaView | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mihir Soni | Disapprove | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Kunal Parmar | Needs Fixing | ||
Victor Thompson (community) | Needs Information | ||
Review via email: mp+212164@code.launchpad.net |
Commit message
Basic version of a AgendaView (flat ordered list of incoming events).
Need autopilot tests.
See http://
Description of the change
Basic version of a AgendaView (flat ordered list of incoming events).
Need autopilot tests.
See http://
Kunal Parmar (pkunal-parmar) wrote : | # |
Kunal Parmar (pkunal-parmar) wrote : | # |
+Item {
13 + id: root
14 + objectName: "AgendaView"
Can you make this a Page? I am planning to make other Views also a Page, to make those loaded using Loader on demand.
Kunal Parmar (pkunal-parmar) wrote : | # |
+ Column {
35 + id: column
36 + anchors.top: parent.top
37 + anchors.topMargin: units.gu(1.5)
38 + width: parent.width; height: parent.height
39 + spacing: units.gu(1)
40 +
41 + anchors.fill: parent
I think If we are using anchors.fill, then we don't need to set width and height.
Kunal Parmar (pkunal-parmar) wrote : | # |
+ Component.
44 + model = GlobalModel.
45 + model.reloaded.
46 + }
As we are loading whole year's events using buildList, I suspect there will be performance problem, might hang UI if there are many events.
I think for this case it might be better to use separate OrganizerModel for agenda view, then you will not need to populate model your self and also it will not rebuild model in case of addition or deletion of event.
But I need to consult EDS developer for the same.
Kunal Parmar (pkunal-parmar) wrote : | # |
54 + var itemIds = intern.
as per discussion here
https:/
In agenda view, we decided to show events only for one month, can you address that.
Rest of changes looks good to me
ybon (yohanboniface) wrote : | # |
Sure, I will try to take time today for this.
Kunal Parmar (pkunal-parmar) wrote : | # |
121 + Tab {
122 + objectName: "agendaTab"
123 + title: i18n.tr("Agenda")
124 + page: Page {
125 + anchors.fill: parent
126 + tools: commonToolBar
127 + AgendaView {
128 + id: agendaView
129 + anchors.fill: parent
130 + }
131 + }
132 + }
Agenda view is already a Page, we need not create another Page container for agenda view.
Kunal Parmar (pkunal-parmar) wrote : | # |
145 +Date.prototype
146 + // TRANSLATORS: this is a time formatting string,
147 + // see http://
148 + var format = qsTr("hh:mm");
149 + return Qt.formatTime(this, format);
150 +}
I was suggested to use following for time date translation, can you also use the same.
var startTime = e.startDateTime
var endTime = e.endDateTime.
BTW above code is from EventDetails.
ybon (yohanboniface) wrote : | # |
Oh, you're right. But then what was you expecting me to do with this comment: https:/
Kunal Parmar (pkunal-parmar) wrote : | # |
> Oh, you're right. But then what was you expecting me to do with this comment:
> https:/
> app/AgendaView/
so, I wanted to you make root element of AgendaView a Page.
12 +Page {
13 + id: root
14 + objectName: "AgendaView"
Which you already did, I have no further comment there.
But, you are creating a Page and putting AgendaView ( which is also a page) inside this page, which is not necessary.
+ page: Page {
125 + anchors.fill: parent
126 + tools: commonToolBar
127 + AgendaView {
so, I think we can directly put AgendaView inside tab, instead of creating intermediate page. Like
+ Tab {
122 + objectName: "agendaTab"
123 + title: i18n.tr("Agenda")
124 + page: AgendaView {
ybon (yohanboniface) wrote : | # |
I've reverted the Page thing to Item for now. I see that in the trunk it's not cleaned yet, so I suggest not to mix MR and to fix Tab/Page structure once for all in a dedicate branch.
ybon (yohanboniface) wrote : | # |
If I replace
Date.prototype.
// TRANSLATORS: this is a date formatting string,
// see http://
var format = qsTr("dd MMMM yyyy");
return Qt.formatDate(this, format);
}
by
Date.prototype.
this.
return this;
}
I only have raw date printed.
It may be that Qt.locale() without argument is not finding any default.
Kunal Parmar (pkunal-parmar) wrote : | # |
>
> Date.prototype.
> this.toLocaleTi
> return this;
> }
>
> I only have raw date printed.
> It may be that Qt.locale() without argument is not finding any default.
ok, I will have a look then
Kunal Parmar (pkunal-parmar) wrote : | # |
I missed something in original comment,
var timeFormat = i18n.tr("hh:mm");
var startTime = e.startDateTime
var endTime = e.endDateTime.
I was suggested to use i18n.tr() instead of qsTr(), and format date/time as shown in above code.
but I am not able to figure out how to use i18n.tr from using from JS.
How about using code similar to above from QML directly for now ?
and then take help from some expert for how to move formating code to JS lib and use i18n.tr from JS,
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:207
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Roman Shchekin (mrqtros) wrote : | # |
section property can be reformatted:
section {
property:
...
}
ybon (yohanboniface) wrote : | # |
@Kunal: I suggest to keep code DRY and well organised/
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:208
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Kunal Parmar (pkunal-parmar) wrote : | # |
> @Kunal: I suggest to keep code DRY and well organised/
> keep the Date custom methods in DateExt (instead of putting generic functions
> in a qml file), and to update there when we know how to properly handle date
> localization in JavaScript. Thoughts?
I personally would prefer correctness over structure of code. Not to say that your code is not correct, but as I said
earlier, I was suggested to use following over Qt.formatDate, so I will suggest you to use the same.
var timeFormat = i18n.tr("hh:mm");
var startTime = e.startDateTime
But if you must use function then I have following suggestion.
- Create a QtObject and move format function there, like done in Defines.js, getReminderLabels() function. that will allow usage of i18n.tr with toLocaleTimeString.
- now that we are using toLocaleTimeString, we can have only single format function that takes DATE/TIME format as argument and we can have constant with well defined name and use function with those constants.
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
Looks good, but I'm not sure I need to see my alarms in there, or indeed where they're coming from..?
ybon (yohanboniface) wrote : | # |
@kunal: ok, will do before next moon ;)
@popey: don't you have the alarm showing also on other views?
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
@ybon, no.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:209
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
ybon (yohanboniface) wrote : | # |
One curious thing about i18n.tr() and JavaScript is that I'm able to use it directly in the JavaScript file in OSMTouch, but not in Calendar. See http://
I need to investigate this.
ybon (yohanboniface) wrote : | # |
@popey: I've merged with trunk, can you please try again and see if alarm things are still shown?
Victor Thompson (vthompson) wrote : | # |
I just tested from trunk and I see my Clock alarms as well: http://
Only the "Test" and "Test2" events should have been shown.
Kunal Parmar (pkunal-parmar) wrote : | # |
+ Component.
48 + mainModel.
49 + }
50 +
51 + function buildList () {
52 + eventModel.clear();
Now that you are using EventListModel {}, you should be able to use it directly with your ListView.
And you should be able to achieve following.
// 3. no way to cheat like adding on the fly a method or property to the ListItem while looping
Kunal Parmar (pkunal-parmar) wrote : | # |
> One curious thing about i18n.tr() and JavaScript is that I'm able to use it
> directly in the JavaScript file in OSMTouch, but not in Calendar. See http://
> azaar.launchpad
> ries.js
> I need to investigate this.
This is because, Calendar JS file is shared library, declared by
.pragma library. But your JS file does not seems to be shared lib.
http://
ybon (yohanboniface) wrote : | # |
Thanks all for answers.
@Kunal: how can I filter alarm events? I don't see where this is done in other event list of calendar app.
Kunal Parmar (pkunal-parmar) wrote : | # |
I am not sure why only agenda view is getting alarm data, but looking at Alarm model source code.
Alarm is stored as todo item type. so if you apply Detail Filter on model with only item type of ItemType.Event
ItemType.
http://
http://
ybon (yohanboniface) wrote : | # |
Status: not able, even with the help of renato, to make the DetailFilter work (here is a smaller test case: http://
> And you should be able to achieve following.
> // 3. no way to cheat like adding on the fly a method or property to the ListItem while looping
No sure how :)
I can use EvenListModel directly as model in my ListView, yes, but I don't know how to set a property on each item with the event *date* value (in string format). Any clue?
Thanks!
Kunal Parmar (pkunal-parmar) wrote : | # |
I will need to check about DetailsFilter, I never tried that filter.
> I can use EvenListModel directly as model in my ListView, yes, but I don't
> know how to set a property on each item with the event *date* value (in string
> format). Any clue?
Regarding using EventListModel directly, something like following should work. Though we need i18n.tr, instead of Qt.formatDate, this is code from Qt example.
}
Following is link for complete example, will be useful.
https:/
Victor Thompson (vthompson) wrote : | # |
In your test code I see the following console output:
file://
Seems like DetailFilter's detail property can not be set directly to the enumeration.
Victor Thompson (vthompson) wrote : | # |
I think you'll also want to merge with trunk and add the Loader infrastructure for the AgendaView tab as well. I believe the tab won't be visible otherwise. I say this because this might also resolve some errors I see in the console with this branch.
Kunal Parmar (pkunal-parmar) wrote : | # |
Victor is right, DetailFilter's details propperty accepts Type object and not type itself.
Needs to do something like below.
Type {
id: typeDetailToMatch
type: Type.Todo
}
DetailFilter {
id: todoFilter
detail: typeDetailToMatch
}
ybon (yohanboniface) wrote : | # |
> I will need to check about DetailsFilter, I never tried that filter.
>
> > I can use EvenListModel directly as model in my ListView, yes, but I don't
> > know how to set a property on each item with the event *date* value (in
> string
> > format). Any clue?
>
> Regarding using EventListModel directly, something like following should work.
> Though we need i18n.tr, instead of Qt.formatDate, this is code from Qt
> example.
>
> TextEdit {
> id: startTime
> font.pixelSize: 12
> text: (model.item) ? Qt.formatDate(
> model.item.
> readOnly: true
> }
>
> Following is link for complete example, will be useful.
> https:/
> b3a:examples/
Sorry, it seems I've not been clear.
The need is to have the date of the event to create the "section" part (the date header that group events of same day).
So we need:
- a property on each item (cannot be a method, section don't want a method)
- the property value need to be the date, without hours, minutes, etc. Because to want to group event by day, so we need events of same day to have the exact same value in the property given to section
- this property need to be a string type (not a date, section seems to only call the toString() of the property), not a Date type
If you have an idea, great! If not, I will but back my ugly workaround... ;)
ybon (yohanboniface) wrote : | # |
> Victor is right, DetailFilter's details propperty accepts Type object and not
> type itself.
> Needs to do something like below.
>
> Type {
> id: typeDetailToMatch
> type: Type.Todo
> }
> DetailFilter {
> id: todoFilter
> detail: typeDetailToMatch
> }
Well, I know that, I've read the documentation too. This example comes right from the DetailFilter page (http://
ybon@edoardo:
file://
We need someone who *knows*. The documentation is useless and wrong (and renato sadly doesn't know either). And I sadly don't have enough time these days to play the riddle for hours :(
Victor Thompson (vthompson) wrote : | # |
Does the following qmltypes file [1] give any useful information? Also, note there's a qmltypes file for QtOrganizer installed by default under "/usr/lib/
[1] https:/
ybon (yohanboniface) wrote : | # |
AFAIK, the available types are here: http://
Michael Hall (mhall119) wrote : | # |
It seems the example given in DetailFilter is incorrect. From what I can tell, the "Type" component doesn't exist, but the "Detail" component has the same properties and would make sense to assign to the 'detail' property of DetailFilter. Also there is no Type enum, but ItemType seems to contain the value used in the example. So maybe something like this:
Detail {
id: typeDetailToMatch
type: ItemType.Todo
}
DetailFilter {
id: todoFilter
detail: typeDetailToMatch
}
Michael Hall (mhall119) wrote : | # |
Or maybe this should use DetailFieldFilter instead of DetailFilter: http://
ybon (yohanboniface) wrote : | # |
Thanks for the inputs, Michael. But no more luck until now :(
For the record, with the first suggestion, same error about type read-only (http://
file://
And with the DetailFieldFilter, I don't get it to return anything (not sure the types match the ones of OrganizerModel), event playing around with values, but I've no specific error.
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
Any progress to report on this Yohan?
ybon (yohanboniface) wrote : | # |
Nope.
As the documentation is wrong, we need someone aware of the secret sauce to be able to move forward :/
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
I've asked Zsombor and Renato to provide guidance here.
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
You should be able to filter events type using this this example:
OrganizerModel {
id: organizer
endPeriod: new Date("2014-12-31")
manager: "eds"
autoUpdate: true
filter: DetailFieldFilter {
id: todoFilter
detail: Detail.ItemType
field: Type.FieldType
value: Type.Todo
}
}
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
You do not need this:
47 + Component.
48 + mainModel.
49 + }
50 +
51 + function buildList () {
52 + eventModel.clear();
53 + // Include all events from 00:00 so you can still consult the past events of the day
54 + // (or just you are late 10 minutes to your RDV, and you need details from the event...)
55 + var itemIds = mainModel.
56 + for(var i = 0 ; i < itemIds.length ; ++i) {
57 + var event = itemIds[(i)];
58 + if( event ) {
59 + // Recreating new ListItem model, because
60 + // 1. I'm not able to take control on section.property formating in ListView
61 + // 2. section in deledate has been cast to string (even if property was a QDateTime
62 + // 3. no way to cheat like adding on the fly a method or property to the ListItem while looping
63 + eventModel.append({
64 + sectionLabel: event.startDate
65 + event: event
66 + });
67 + }
68 + }
69 + }
70 +
71 + ListModel {
72 + id: eventModel
73 + }
60 + // 1. I'm not able to take control on section.property formating in ListView
61 + // 2. section in deledate has been cast to string (even if property was a QDateTime
62 + // 3. no way to cheat like adding on the fly a method or property to the ListItem while looping
Why do you need cheat the section property? If the section was cast to string you can use the string to convert back to a QDateTime object using the "section" property no?
ybon (yohanboniface) wrote : | # |
Thanks all!
> Why do you need cheat the section property? If the section was cast to string you can use the string to convert back
> to a QDateTime object using the "section" property no?
Because items are grouped by section *before* I can do anything on the value, so if I keep passing the raw Date value (including hours, minutes..), then every item event will ends in its own section, which is not what we want.
I'm gonna test our example code and give feedback asap.
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
Renato / Yohan - will you both be around for the calendar meeting tomorrow at 13:00 UTC so we can increase the velocity of this merge?
ybon (yohanboniface) wrote : | # |
Sounds possible for me, so I will be there :)
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
You can make this simpler:
51 + function buildList () {
52 + eventModel.clear();
53 + // Include all events from 00:00 so you can still consult the past events of the day
54 + // (or just you are late 10 minutes to your RDV, and you need details from the event...)
55 + var itemIds = mainModel.
56 + for(var i = 0 ; i < itemIds.length ; ++i) {
57 + var event = itemIds[(i)];
58 + if( event ) {
59 + // Recreating new ListItem model, because
60 + // 1. I'm not able to take control on section.property formating in ListView
61 + // 2. section in deledate has been cast to string (even if property was a QDateTime
62 + // 3. no way to cheat like adding on the fly a method or property to the ListItem while looping
63 + eventModel.append({
64 + sectionLabel: event.startDate
65 + event: event
66 + });
67 + }
68 + }
69 + }
function buildList () {
// Include all events from 00:00 so you can still consult the past events of the day
// (or just you are late 10 minutes to your RDV, and you need details from the event...)
var items = mainModel.items
for(var i = 0 ; i < itemIds.length ; ++i) {
var event = items[i]
}
}
}
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:210
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
This is looking great, thanks Yohan & Renato.
I'm keen to see this landed, it's very useful. Kunal, can you please review?
ybon (yohanboniface) wrote : | # |
Great news!
(6:30 Gym, seriously? ;) )
Victor Thompson (vthompson) wrote : | # |
I'll test this out right now. I'm looking at the translation string of each of the MPs in the queue and one thing I just noticed is that the empty state for the agenda view is "No incoming event", should this be "No upcoming event"?
Victor Thompson (vthompson) wrote : | # |
I still see alarms in the Agenda View: http://
Maybe the issue with alarms in the agenda view can be fixed later?
One thing I want to know is did we consider placing the agenda view in the toolbar? It doesn't fit the same flat pattern of Year/Month/
Alan Pope πΊπ§π± π¦ (popey) wrote : | # |
My inclination is to say that "day/week/
I would see "New event" being a button on the right end of the header/toolbar, and a quick action launched via a quick swipe up from the bottom.
Kunal Parmar (pkunal-parmar) wrote : | # |
101 + pageStack.
we need to pass model as well now,
like
pageStack.
Kunal Parmar (pkunal-parmar) wrote : | # |
Agenda tab needs to follow loader architecture like other tab,
something like below,
Tab {
id: agendaTab
}
}
Kunal Parmar (pkunal-parmar) wrote : | # |
148 + var format = qsTr("hh:mm");
149 + return Qt.formatTime(this, format);
This still needs to be changed to use i18n.tr, as suggested in my previous review comment.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:211
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Mihir Soni (mihirsoni) wrote : | # |
Rejecting this branch , as new branch has been merged to the trunk.
https:/
Unmerged revisions
- 211. By ybon
-
Pass model to pageStack.push()
- 210. By ybon
-
Simpler buildList, thanks to Renato
- 209. By ybon
-
merge
- 208. By ybon
-
Merge with trunk
- 207. By ybon
-
Pick only next month events in AgendaView
- 206. By ybon
-
Use an Item for AgendaView for now
- 205. By ybon
-
No need to width/height when using anchors.fill
- 204. By ybon
-
Replace Item by Page
- 203. By ybon
-
Use QtObject instead of item property
- 202. By ybon
-
Merged from trunk
Preview Diff
1 | === added file 'AgendaView.qml' |
2 | --- AgendaView.qml 1970-01-01 00:00:00 +0000 |
3 | +++ AgendaView.qml 2014-05-21 09:10:19 +0000 |
4 | @@ -0,0 +1,107 @@ |
5 | +import QtQuick 2.0 |
6 | +import Ubuntu.Components 0.1 |
7 | +import Ubuntu.Components.ListItems 0.1 as ListItem |
8 | + |
9 | +import "dateExt.js" as DateExt |
10 | + |
11 | +Item { |
12 | + id: root |
13 | + objectName: "AgendaView" |
14 | + |
15 | + property var startDay: DateExt.today(); |
16 | + |
17 | + EventListModel { |
18 | + id: mainModel |
19 | + startPeriod: startDay.midnight() |
20 | + endPeriod: startPeriod.addDays(30).endOfDay() |
21 | + } |
22 | + |
23 | + Label { |
24 | + id: noEvent |
25 | + objectName: "noEvent" |
26 | + |
27 | + width: parent.width-units.gu(6) |
28 | + visible: eventModel.count === 0 |
29 | + anchors.centerIn: parent |
30 | + |
31 | + fontSize: "medium" |
32 | + wrapMode: Text.WordWrap |
33 | + horizontalAlignment: Text.AlignHCenter |
34 | + |
35 | + text: i18n.tr("No incoming event") |
36 | + } |
37 | + |
38 | + Column { |
39 | + id: column |
40 | + anchors.top: parent.top |
41 | + anchors.topMargin: units.gu(1.5) |
42 | + spacing: units.gu(1) |
43 | + |
44 | + anchors.fill: parent |
45 | + |
46 | + |
47 | + Component.onCompleted: { |
48 | + mainModel.addModelChangeListener(buildList); |
49 | + } |
50 | + |
51 | + function buildList () { |
52 | + eventModel.clear(); |
53 | + // Include all events from 00:00 so you can still consult the past events of the day |
54 | + // (or just you are late 10 minutes to your RDV, and you need details from the event...) |
55 | + var items = mainModel.items; |
56 | + for(var i = 0 ; i < items.length ; ++i) { |
57 | + var event = items[i]; |
58 | + // Recreating new ListItem model, because |
59 | + // 1. I'm not able to take control on section.property formating in ListView |
60 | + // 2. section in deledate has been cast to string (even if property was a QDateTime |
61 | + // 3. no way to cheat like adding on the fly a method or property to the ListItem while looping |
62 | + eventModel.append({ |
63 | + sectionLabel: event.startDateTime.formatDate(), |
64 | + event: event |
65 | + }); |
66 | + } |
67 | + } |
68 | + |
69 | + ListModel { |
70 | + id: eventModel |
71 | + } |
72 | + |
73 | + Component { |
74 | + id: dateHeading |
75 | + ListItem.Header { |
76 | + text: section |
77 | + } |
78 | + } |
79 | + |
80 | + ListView { |
81 | + id: eventList |
82 | + model: eventModel |
83 | + |
84 | + width: parent.width |
85 | + height: parent.height |
86 | + anchors { left: parent.left; right: parent.right} |
87 | + clip: true |
88 | + |
89 | + section { |
90 | + property: "sectionLabel" |
91 | + criteria: ViewSection.FullString |
92 | + labelPositioning: ViewSection.InlineLabels |
93 | + delegate: dateHeading |
94 | + } |
95 | + |
96 | + delegate: ListItem.Standard { |
97 | + id: eventItem |
98 | + text: event.startDateTime.formatTime() + " - " + event.displayLabel |
99 | + progression: true |
100 | + onClicked: { |
101 | + pageStack.push(Qt.resolvedUrl("EventDetails.qml"),{"event": model.event, "model": model}); |
102 | + } |
103 | + |
104 | + } |
105 | + Scrollbar { |
106 | + flickableItem: eventList |
107 | + } |
108 | + } |
109 | + |
110 | + } |
111 | +} |
112 | |
113 | === modified file 'calendar.qml' |
114 | --- calendar.qml 2014-04-27 05:12:51 +0000 |
115 | +++ calendar.qml 2014-05-21 09:10:19 +0000 |
116 | @@ -363,6 +363,20 @@ |
117 | } |
118 | } |
119 | } |
120 | + |
121 | + Tab { |
122 | + objectName: "agendaTab" |
123 | + title: i18n.tr("Agenda") |
124 | + page: Page { |
125 | + anchors.fill: parent |
126 | + tools: commonToolBar |
127 | + AgendaView { |
128 | + id: agendaView |
129 | + anchors.fill: parent |
130 | + } |
131 | + } |
132 | + } |
133 | + |
134 | } |
135 | } |
136 | } |
137 | |
138 | === modified file 'dateExt.js' |
139 | --- dateExt.js 2014-03-22 03:07:26 +0000 |
140 | +++ dateExt.js 2014-05-21 09:10:19 +0000 |
141 | @@ -90,6 +90,20 @@ |
142 | && this.getFullYear() === otherDay.getFullYear() ); |
143 | } |
144 | |
145 | +Date.prototype.formatTime = function (d) { |
146 | + // TRANSLATORS: this is a time formatting string, |
147 | + // see http://qt-project.org/doc/qt-5.0/qtqml/qml-qtquick2-date.html#details for valid expressions |
148 | + var format = qsTr("hh:mm"); |
149 | + return Qt.formatTime(this, format); |
150 | +} |
151 | + |
152 | +Date.prototype.formatDate = function () { |
153 | + // TRANSLATORS: this is a date formatting string, |
154 | + // see http://qt-project.org/doc/qt-5.0/qtqml/qml-qtquick2-date.html#details for valid expressions |
155 | + var format = qsTr("dd MMMM yyyy"); |
156 | + return Qt.formatDate(this, format); |
157 | +} |
158 | + |
159 | function weekCount(year, month_number) { |
160 | var firstOfMonth = new Date(year, month_number, 1); |
161 | var lastOfMonth = new Date(year, month_number+1, 0); |
16 + property var model;
This looks like private variable for this view.
Can we shift it to internal QtObject like, and use that
QtObject{
id: internal
property var model;
}