Bug #72719 [Ver->Csd]: Relative datetime format ignores weekday on sundays only
| From: | derick@php.net | Date: | Sun, 12 Feb 2017 20:20:00 +0000 |
| Subject: | Bug #72719 [Ver->Csd]: Relative datetime format ignores weekday on sundays only | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207295@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72719&edit=1
ID: 72719
Updated by: derick@php.net
Reported by: filip at prochazka dot su
Summary: Relative datetime format ignores weekday on sundays
only
-Status: Verified
+Status: Closed
Type: Bug
Package: Date/time related
Operating System: Linux
PHP Version: 7.1.0beta1
Assigned To: derick
Block user comment: N
Private report: N
New Comment:
The fix for this bug has been committed.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2017-01-16 07:40:30] requinix@php.net
Related To: Bug #73942
------------------------------------------------------------------------
[2016-08-01 15:43:28] derick@php.net
> However it appears that the fix introduced what you're seeing now. On
> a Sunday, "$dayname $reltext week" effectively ignores the $dayname.
It should do that on every weekday if the current day is that weekday.
> no difference between "$dayname next week" and "next week $dayname"
That is correct too. The order does not matter. The whole string is parsed in one go. Elements in
it, are not applied in order.
Relative to Sun 2016-07-31
Mon next week = Mon 2016-08-01
Tue next week = Mon 2016-08-01
Wed next week = Mon 2016-08-01
Thu next week = Mon 2016-08-01
Fri next week = Mon 2016-08-01
Sat next week = Mon 2016-08-01
Sun next week = Sun 2016-08-07
This indeed looks like a bug. I will need to check that.
------------------------------------------------------------------------
[2016-08-01 14:13:17] requinix@php.net
No, you're right: this is a bug. I got hung up on the Sunday/Monday week issue and missed the
different result seen only on Sundays.
Old behavior (pre-PHP 5.6.23/7.0.8), Sunday and Monday were considered part of the same week but
Monday was the start of the week. This was clearly a bug (bug #63740). New behavior is that Sunday
and Monday are in different weeks. https://3v4l.org/nXoDJ
However it appears that the fix introduced what you're seeing now. On a Sunday, "$dayname
$reltext week" effectively ignores the $dayname.
https://3v4l.org/qv8vI - Sunday behaves differently than the
rest of the week
https://3v4l.org/XtSCi - no difference between "$dayname
next week" and "next week $dayname"
https://3v4l.org/fmCoi - unsurprisingly, "this week"
has the same problem
------------------------------------------------------------------------
[2016-08-01 08:07:36] filip at prochazka dot su
Also, I think you've overlooked an important detail. The provided code is broken on every
Sunday, but for example today, it's working according to my expectation :)
This inconsistency is a big problem, since you can write something at Tuesday and it works, so you
deploy it at Friday and on Sunday it breaks.
------------------------------------------------------------------------
[2016-07-31 10:48:29] filip at prochazka dot su
Thanks Damian, didn't find that one :-/
Anyway, I don't like that it's closed, as this broke BC in patch version. Would be
acceptable in 7.1, but look at the versions in the actual output. I'm pretty sure that's
wrong.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=72719
--
Edit this bug report at https://bugs.php.net/bug.php?id=72719&edit=1