Closed (duplicate)
Project:
Date
Version:
7.x-2.x-dev
Component:
Date API
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
29 Jan 2015 at 12:28 UTC
Updated:
3 Feb 2016 at 02:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
nikita.izotov commentedComment #2
predy commentedI've recently come across this issue. The problem is that in the date_api (when ISO standard is respected) the line where the date object is modified with the value of the next Monday is given in a wrong format.
+ 1 Mondayis invalid for strtotime().My patch solves this problem.
Comment #3
predy commentedComment #4
anpolimusNeeds test first.
Comment #5
anpolimusComment #6
yaelsho commentedAny idea how to solve this issue for site which can't "Use ISO-8601 week numbers"?
Comment #7
Peter Arius commenteddate 7.x-2.9+5-dev (2015-Dez-10)
calendar 7.x-3.5
confirming that patch #2 (#2416421-2: Wrong week numbering for 2016) solves the problem for me
Comment #8
rv0 commentedwhat about https://www.drupal.org/node/1874422#comment-10330407 (which solved it for me)
from #1874422: Pager may cause incorrect "prev" or "next" link
Comment #9
anpolimusNeeds reroll
Comment #10
luison commentedComment #2, works for me.
Comment #11
anpolimusComment #12
akolahi commentedPatch #2 also solves the problem for me :)
Comment #13
loziju commentedTested #2 is working for me, too.
Rerolled for 7.x-2.x-dev.
Comment #14
moonray commentedThis isn't a complete fix. `date_week_range()` function needs fixing as well.
Comment #15
moonray commentedHere's a patch that includes updates to
date_week_range()function, when not using iso8601.Comment #16
moonray commentedHere's a patch that includes updates to
date_week_range()function, when not using iso8601.Comment #17
moonray commentedFixed the end date that the date_week_range function provides to make sure it includes dates on the last day of the week.
Comment #18
rv0 commentedRestating (see #8) that https://www.drupal.org/node/1874422 is fixing the exact same issue and has a working patch in #23
not sure which is better, but only one issue should be active.
Comment #19
loziju commentedAfaik https://www.drupal.org/node/1874422 only solves the next link. It didn't solve the problem described by @anpolimus.
Surely it didn't solve the issue I have, which is the same as the one faced by @anpolimus.
Comment #20
loziju commentedSorry I may be too quick to comment above. I got mixed up with another next link issue thread. Let me retry on my end.
Comment #21
admiralfdg commented#17 fixes the week numbering but breaks the pager back links (they point to the current week) and misidentifies the current week (a week ahead, so the week of the 17th is showing the 24th) on my install.
Comment #22
drasgardian commentedAttached patch corrects the pager links.
The difficulty was getting date_week() to convert an ISO week to a calendar week, taking into account the complexity of ISO weeks, which start on Mondays rather than Sundays, yet the first Monday of a year is not necessarily the first week of the year. The week with the first Thursday in it is the first week of the year.. did my head in for a while.
Comment #24
moonray commentedThe patch doesn't handle date_week() and date_week_range () properly. Needs work.
Comment #25
hass commentedThere is a patch for months issue.
Comment #26
hass commentedI guess 7 days is clearer...
Comment #27
erik frèrejean@hass, the month issue appears to be something different. That one is caused because
date_modify('...', '+1 month');actually adds the number of days in the current month. So januari has 31 days, causing "Januari 31st + 31 -> February 31st -> March 2nd". This seems to be a slightly different issue which I'm not familiar with.However there is a lot of inconsistency across PHP versions when modifying the date with a week: https://3v4l.org/94PBa
Comment #28
SeanA commentedThe patch at #23 on #1874422: Pager may cause incorrect "prev" or "next" link works for me... but part of the fix has already been committed to 2.x-dev #2375235: Calendar block Next/Prev navigation broken, so the patch there needs to be re-rolled (see maintainer's request on that thread). The patch here and the patch there are both dealing with the same bits of code, so let's keep our efforts together on one issue.