← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

Re: [Merge] lp:~gary-wzl77/ubuntu-calendar-app/fix_1515722 into lp:ubuntu-calendar-app

 

added a comment, otherwise code looks fine

Diff comments:

> 
> === modified file 'TimeLineBase.qml'
> --- TimeLineBase.qml	2015-08-20 12:27:59 +0000
> +++ TimeLineBase.qml	2015-11-27 01:49:25 +0000
> @@ -221,28 +221,27 @@
>          if (event.endDateTime - day  == 0)
>              return;
>  
> -        if (event.endDateTime.getDate() - day.getDate() == 0 &&
> -                event.startDateTime.getDate() - day.getDate() == 0) {
> +        if (event.endDateTime.isSameDay(day) &&
> +                event.endDateTime.isSameDay(event.startDateTime)) {
>              hour = event.startDateTime.getHours();
>              yPos = (( event.startDateTime.getMinutes() * hourHeight) / 60) + hour * hourHeight
> -            durationMin = (event.endDateTime.getHours() - event.startDateTime.getHours()) * 60;
> -            durationMin += (event.endDateTime.getMinutes() - event.startDateTime.getMinutes());
> +            durationMin = (event.endDateTime - event.startDateTime)  / Date.msPerMin;
>          }
> -        if (event.endDateTime.getDate() - day.getDate() == 0 &&
> -                event.startDateTime - day < 0) {
> +        if (!event.startDateTime.isSameDay(day) &&
> +                event.endDateTime.isSameDay(day)) {
>              hour = 0;
>              yPos = 0;
>              durationMin = event.endDateTime.getHours() * 60;
>              durationMin += event.endDateTime.getMinutes();
>          }
> -        if (event.startDateTime.getDate() - day.getDate() == 0 &&
> -                event.endDateTime - day >= Date.msPerDay) {
> +        if (event.startDateTime.isSameDay(day) &&
> +                !event.endDateTime.isSameDay(day)) {
>              hour = event.startDateTime.getHours();
>              yPos = (( event.startDateTime.getMinutes() * hourHeight) / 60) + hour * hourHeight
>              durationMin = (24 - event.startDateTime.getHours()) * 60;
>          }
> -        if (event.endDateTime - day  >= Date.msPerDay &&
> -                event.startDateTime- day <= 0) {
> +        if (!event.startDateTime.isSameDay(day) &&

I think event that span whole day should go to whole day section, instead of filling while time line. Though this should be discussed with UX team.

> +                !event.endDateTime.isSameDay(day)) {
>              hour = 0;
>              yPos = 0;
>              durationMin = 24 * 60;


-- 
https://code.launchpad.net/~gary-wzl77/ubuntu-calendar-app/fix_1515722/+merge/278759
Your team Ubuntu Calendar Developers is requested to review the proposed merge of lp:~gary-wzl77/ubuntu-calendar-app/fix_1515722 into lp:ubuntu-calendar-app.


References