Package: release.debian.org Severity: normal Tags: wheezy User: release.debian....@packages.debian.org Usertags: pu
Hi, I’m proposing a small update of gnome-shell in wheezy to fix an annoying bug in the week number computation that is triggered in 2015. gnome-shell (3.4.2-7+deb7u2) stable; urgency=low * 29_week_number.patch: backported patch from upstream. Fix week number computation, which is wrong in 2015. Thanks for considering, -- .''`. Josselin Mouette : :' : `. `' `-
Backported from 412d40f8448e0f83cd6bfd6c4841b25b010378d7 https://bugzilla.gnome.org/show_bug.cgi?id=736722 Index: gnome-shell-3.4.2/js/ui/calendar.js =================================================================== --- gnome-shell-3.4.2.orig/js/ui/calendar.js 2015-03-26 21:34:47.064453237 +0100 +++ gnome-shell-3.4.2/js/ui/calendar.js 2015-03-26 21:34:23.752826288 +0100 @@ -78,23 +78,6 @@ function _formatEventTime(event, clockFo return ret; } -function _getCalendarWeekForDate(date) { - // Based on the algorithms found here: - // http://en.wikipedia.org/wiki/Talk:ISO_week_date - let midnightDate = new Date(date.getFullYear(), date.getMonth(), date.getDate()); - // Need to get Monday to be 1 ... Sunday to be 7 - let dayOfWeek = 1 + ((midnightDate.getDay() + 6) % 7); - let nearestThursday = new Date(midnightDate.getFullYear(), midnightDate.getMonth(), - midnightDate.getDate() + (4 - dayOfWeek)); - - let jan1st = new Date(nearestThursday.getFullYear(), 0, 1); - let diffDate = nearestThursday - jan1st; - let dayNumber = Math.floor(Math.abs(diffDate) / MSECS_IN_DAY); - let weekNumber = Math.floor(dayNumber / 7) + 1; - - return weekNumber; -} - function _getDigitWidth(actor){ let context = actor.get_pango_context(); let themeNode = actor.get_theme_node(); @@ -592,7 +575,7 @@ const Calendar = new Lang.Class({ { row: row, col: offsetCols + (7 + iter.getDay() - this._weekStart) % 7 }); if (this._useWeekdate && iter.getDay() == 4) { - let label = new St.Label({ text: _getCalendarWeekForDate(iter).toString(), + let label = new St.Label({ text: iter.toLocaleFormat('%V'), style_class: 'calendar-day-base calendar-week-number'}); this.actor.add(label, { row: row, col: 0, y_align: St.Align.MIDDLE });