Merge lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Kunal Parmar on 2015-05-09 | ||||
| Approved revision: | 615 | ||||
| Merged at revision: | 642 | ||||
| Proposed branch: | lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber | ||||
| Merge into: | lp:ubuntu-calendar-app | ||||
| Diff against target: |
98 lines (+18/-14) 4 files modified
TimeLineBaseComponent.qml (+1/-1) TimeLineHeader.qml (+4/-2) dateExt.js (+4/-10) tests/autopilot/calendar_app/tests/test_dayview.py (+9/-1) |
||||
| To merge this branch: | bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Carla Sella | 2015-04-24 | Approve on 2015-05-07 | |
| Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve on 2015-04-29 | |
| Nicholas Skaggs | Needs Fixing on 2015-04-23 | ||
| Alan Pope πΊπ§π± π¦ | 2015-04-02 | Approve on 2015-04-12 | |
|
Review via email:
|
|||
Commit Message
Resolves Bug #1435542
Calendar app displays wrong week number
Description of the Change
Resolves Bug #1435542
Calendar app displays wrong week number
PASSED: Continuous integration, rev:609
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
PASSED: Continuous integration, rev:611
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
- 612. By Kunal Parmar on 2015-04-19
-
conflict resolved
FAILED: Continuous integration, rev:612
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 613. By Kunal Parmar on 2015-04-19
-
logs added
FAILED: Continuous integration, rev:613
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 614. By Kunal Parmar on 2015-04-22
-
logging added
PASSED: Continuous integration, rev:614
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Nicholas Skaggs (nskaggs) wrote : | # |
If you watch the video, it shows going to dayview selects the 19th of April, which imho, would be the start of week 17. But it still displays week 16.
I also wonder why selecting dayview takes you to the following week, instead of the current week.
| Nicholas Skaggs (nskaggs) wrote : | # |
If you need help, I'll ask Carla to take a look here. She's familar with the codebase and the locale issues here ;-)
| Carla Sella (carla-sella) wrote : | # |
@Nicholas: I have tested this branch and it is ok. When I put en_US locale weeks start on Sundays and end on Saturdays and Week numbers are right (w17 starts Sun 19 Apr ends Sat 25 Apr - w18 starts Sun 26 Apr ends Sat 2 May). When I put it_IT locale weeks start on Mondays and end on Sundays (w17 starts Mon 20 Apr and ends Sun 26 Apr - w18 starts Mon 27 Apr and ends Sun 3 May).
I wanted to fix the test: TestDayView.
This works:
locale = self.app.
if locale == ('it_IT', 'UTF-8'):
week = int(now.
elif locale == ('en_US', 'UTF-8'):
week = int(now.
But I do not think it's the best way to do it as I will have to put all the countries in.
I am still tyring to find a way to get the first day of the week using something like calendar.
Have you guys got an idea how to do this ?
Carla
- 615. By Kunal Parmar on 2015-04-29
-
First day of week exposed to python
| Kunal Parmar (pkunal-parmar) wrote : | # |
Hi Carla,
I exposed firstDayOfWeek property to python by introducing below in TimeLineHeader.qml
property int firstDayOfWeek: Qt.locale(
Let me know if that helps.
Thanks,
Kunal
PASSED: Continuous integration, rev:615
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Carla Sella (carla-sella) wrote : | # |
@Kunal: Great! Thanks that's very useful. I have only one doubt though: I have set locale en_US on my desktop but the firstDayOfWeek property is equal to 0 I would expect it to be 6. If I set locale to it_IT firstDayOfWeek property equals 1, I would expect it to be 0.
I can fix the code to work woth 0 and 1, but just to be sure this is what you wanted to achieve and that this will work with other locals.
| Kunal Parmar (pkunal-parmar) wrote : | # |
> @Kunal: Great! Thanks that's very useful. I have only one doubt though: I have
> set locale en_US on my desktop but the firstDayOfWeek property is equal to 0 I
> would expect it to be 6. If I set locale to it_IT firstDayOfWeek property
> equals 1, I would expect it to be 0.
>
> I can fix the code to work woth 0 and 1, but just to be sure this is what you
> wanted to achieve and that this will work with other locals.
Hi Carla,
I am quite not sure what you mean.
Qt locale will return 0 for Sunday as first day of week and will return 1 for monday.
Let me know if you need more information.
| Carla Sella (carla-sella) wrote : | # |
Hi Kunal, I ment that with calendar related functions (like calendar.
But I suppose what you did could still be ok, I will just have to put a note in the code otherwise after some time I will not remember that 0 is for Sunday as first day of week and 1 is for monday.
| Carla Sella (carla-sella) wrote : | # |
I will put a note in my tests. So this is ok for me.


FAILED: Continuous integration, rev:608 91.189. 93.70:8080/ job/ubuntu- calendar- app-ci/ 1122/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 2480 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 2480/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/ubuntu- calendar- app-utopic- amd64-ci/ 593 91.189. 93.70:8080/ job/ubuntu- calendar- app-vivid- amd64-ci/ 119
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- calendar- app-ci/ 1122/rebuild
http://