ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #01234
[Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
Kunal Parmar has proposed merging lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app.
Commit message:
Resolves Bug #1435542
Calendar app displays wrong week number
Requested reviews:
Ubuntu Calendar Developers (ubuntu-calendar-dev)
Related bugs:
Bug #1435542 in ubiquity (Ubuntu): "Calendar app displays wrong week number"
https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1435542
For more details, see:
https://code.launchpad.net/~pkunal-parmar/ubuntu-calendar-app/WeekNumber/+merge/255078
Resolves Bug #1435542
Calendar app displays wrong week number
--
Your team Ubuntu Calendar Developers is requested to review the proposed merge of lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app.
=== modified file 'TimeLineBaseComponent.qml'
--- TimeLineBaseComponent.qml 2015-02-19 13:50:29 +0000
+++ TimeLineBaseComponent.qml 2015-04-02 12:57:21 +0000
@@ -31,7 +31,7 @@
property var keyboardEventProvider;
property date startDay: DateExt.today();
- property int weekNumber: startDay.weekNumber();
+ property int weekNumber: startDay.weekNumber(Qt.locale().firstDayOfWeek);
property bool isActive: false
property alias contentY: timeLineView.contentY
property alias contentInteractive: timeLineView.interactive
=== modified file 'TimeLineHeader.qml'
--- TimeLineHeader.qml 2015-02-19 13:50:29 +0000
+++ TimeLineHeader.qml 2015-04-02 12:57:21 +0000
@@ -45,7 +45,7 @@
Label{
id: weekNumLabel
objectName: "weeknumber"
- text: i18n.tr("W") + root.weekNumber
+ text: i18n.tr("W") + startDay.weekNumber(Qt.locale().firstDayOfWeek)
fontSize: "small"
height: units.gu(5)
width: parent.width
=== modified file 'dateExt.js'
--- dateExt.js 2014-08-18 16:48:54 +0000
+++ dateExt.js 2015-04-02 12:57:21 +0000
@@ -85,16 +85,10 @@
return this.midnight().addDays(1 - this.getDate())
}
-Date.prototype.weekNumber = function() {
- var date = this.weekStart(1).addDays(3) // Thursday midnight
- var newYear = new Date(date.getFullYear(), 0 /*Jan*/, 1 /*the 1st*/)
- var n = 0
- var tx = date.getTime(), tn = newYear.getTime()
- while (tn < tx) {
- tx = tx - Date.msPerWeek
- n = n + 1
- }
- return n
+Date.prototype.weekNumber = function(weekStartDay) {
+ var date = this.weekStart(weekStartDay).addDays(3) // Thursday midnight
+ var onejan = new Date(this.getFullYear(), 0, 3);
+ return Math.ceil((((date - onejan) / 86400000) + onejan.getDay()+1)/7);
}
Date.prototype.weeksInMonth = function(weekday) {
Follow ups
-
[Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: noreply, 2015-05-09
-
[Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Kunal Parmar, 2015-05-09
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Carla Sella, 2015-05-07
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Carla Sella, 2015-05-07
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Carla Sella, 2015-04-29
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Ubuntu Phone Apps Jenkins Bot, 2015-04-29
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Kunal Parmar, 2015-04-29
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Carla Sella, 2015-04-26
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Nicholas Skaggs, 2015-04-23
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Nicholas Skaggs, 2015-04-23
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Ubuntu Phone Apps Jenkins Bot, 2015-04-22
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Ubuntu Phone Apps Jenkins Bot, 2015-04-19
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Ubuntu Phone Apps Jenkins Bot, 2015-04-19
-
[Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Ubuntu Phone Apps Jenkins Bot, 2015-04-17
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Ubuntu Phone Apps Jenkins Bot, 2015-04-17
-
[Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Kunal Parmar, 2015-04-17
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Ubuntu Phone Apps Jenkins Bot, 2015-04-16
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Ubuntu Phone Apps Jenkins Bot, 2015-04-12
-
[Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Ubuntu Phone Apps Jenkins Bot, 2015-04-12
-
[Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Alan Pope , 2015-04-12
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Alan Pope , 2015-04-12
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Ubuntu Phone Apps Jenkins Bot, 2015-04-05
-
Re: [Merge] lp:~pkunal-parmar/ubuntu-calendar-app/WeekNumber into lp:ubuntu-calendar-app
From: Ubuntu Phone Apps Jenkins Bot, 2015-04-02