Code review comment for lp:~yohanboniface/ubuntu-calendar-app/AgendaView

Revision history for this message
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.startDateTime) : ""
> readOnly: true
> }
>
> Following is link for complete example, will be useful.
> https://qt.gitorious.org/qt/qtpim/source/cdbe3d4a34f728caaac15eccc9fdca3195b60
> b3a:examples/organizer/qmlorganizerlistview/qmlorganizerlistview.qml

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... ;)

« Back to merge proposal