~pkunal-parmar/ubuntu-calendar-app/ICalImport

« back to all changes in this revision

Viewing changes to EventDetails.qml

  • Committer: Tarmac
  • Author(s): Kunal Parmar
  • Date: 2013-10-14 13:57:42 UTC
  • mfrom: (124.3.10 ubuntu-calendar-app)
  • Revision ID: tarmac-20131014135742-xatlilnykrxfy2as
DataModel moved to use QtOrganizer,
Organizer uses EDS as data source,
Related changes required to use QtOrganizer
.

Approved by David Planella, Ubuntu Phone Apps Jenkins Bot, Renato Araujo Oliveira Filho.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import Ubuntu.Components.Popups 0.1
4
4
import Ubuntu.Components.ListItems 0.1
5
5
 
6
 
import "dataService.js" as DataService
7
 
 
8
6
Page {
9
7
    id: root
10
8
 
29
27
        var location="-15.800513,-47.91378";
30
28
        //var location ="Terry' Cafe, 158 Great Suffold St, London, SE1 1PE";
31
29
 
32
 
        timeLabel.text = Qt.formatDateTime(e.startTime,"hh:mm") + " - " + Qt.formatDateTime(e.endTime,"hh:mm");
33
 
        dateLabel.text = Qt.formatDateTime(e.startTime,"ddd, d MMMM");
34
 
        if( e.title)
35
 
            titleLabel.text = e.title;
36
 
 
37
 
        locationLabel.text = location;
38
 
        if( e.message ) {
39
 
            descLabel.text = e.message;
40
 
        }
41
 
 
42
 
        var venues = []
43
 
        DataService.getVenues(e, venues)
44
 
        if( venues.length > 0 ) {
45
 
            //FIXME: what to do for multiple venue
46
 
            var place = venues[0];
47
 
            locationLabel.text = place.address;
48
 
            if( place.latitude && place.longitude) {
49
 
                location = place.latitude +"," + place.longitude;
50
 
            }
51
 
        }
52
 
 
53
 
        var attendees = []
54
 
        DataService.getAttendees(e, attendees)
 
30
        // TRANSLATORS: this is a time formatting string,
 
31
        // see http://qt-project.org/doc/qt-5.0/qtqml/qml-qtquick2-date.html#details for valid expressions
 
32
        var timeFormat = i18n.tr("hh:mm");
 
33
        var startTime = e.startDateTime.toLocaleTimeString(Qt.locale(), timeFormat);
 
34
        var endTime = e.endDateTime.toLocaleTimeString(Qt.locale(), timeFormat);
 
35
        // TRANSLATORS: the first argument (%1) refers to a start time for an event,
 
36
        // while the second one (%2) refers to the end time
 
37
        timeLabel.text =  i18n.tr("%1 - %2").arg(startTime).arg(endTime);
 
38
        var dateFormat = i18n.tr("ddd, d MMMM");
 
39
        dateLabel.text = e.startDateTime.toLocaleDateString(Qt.locale(),dateFormat);
 
40
 
 
41
        if( e.displayLabel) {
 
42
            titleLabel.text = e.displayLabel;
 
43
        }
 
44
 
 
45
        if( e.location ) {
 
46
            locationLabel.text = e.location;
 
47
        }
 
48
 
 
49
        if( e.description ) {
 
50
            descLabel.text = e.description;
 
51
        }
 
52
 
 
53
        var attendees = e.attendees;
 
54
 
55
55
        contactModel.clear();
56
 
        for( var j = 0 ; j < attendees.length ; ++j ) {
57
 
            contactModel.append( {"name": attendees[j] } );
 
56
        if( attendees !== undefined ) {
 
57
            for( var j = 0 ; j < attendees.length ; ++j ) {
 
58
                contactModel.append( {"name": attendees[j].name } );
 
59
            }
58
60
        }
59
61
 
60
62
        // FIXME: need to cache map image to avoid duplicate download every time