Bug #72719 [Com]: Relative datetime format ignores weekday on sundays only

From: Date: Mon, 01 Aug 2016 08:07:42 +0000
Subject: Bug #72719 [Com]: Relative datetime format ignores weekday on sundays only
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202792@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 Comment by: filip at prochazka dot su Reported by: filip at prochazka dot su Summary: Relative datetime format ignores weekday on sundays only Status: Duplicate Type: Bug Package: Date/time related Operating System: Linux PHP Version: 7.1.0beta1 Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ [2016-07-31 10:45:31] filip at prochazka dot su Fixed the title, as the preview function on bugs.php.net is buggy and reset's it when you click edit the preview :-/ ------------------------------------------------------------------------ [2016-07-31 10:18:37] requinix@php.net Take a look at bug #72514. ------------------------------------------------------------------------ [2016-07-31 10:14:01] filip at prochazka dot su Description: ------------ https://3v4l.org/hrZsA It works as expected at monday to saturday. But on sunday, it always returns monday no matter what weekday you give it, except sunday, that one works. Test script: --------------- var_dump(new DateTimeImmutable('Monday next week 13:00')); var_dump(new DateTimeImmutable('Tuesday next week 14:00')); var_dump(new DateTimeImmutable('Wednesday next week 14:00')); var_dump(new DateTimeImmutable('Thursday next week 15:00')); var_dump(new DateTimeImmutable('Friday next week 16:00')); var_dump(new DateTimeImmutable('Saturday next week 17:00')); var_dump(new DateTimeImmutable('Sunday next week 18:00')); Expected result: ---------------- 2016-08-08 13:00:00 2016-08-09 14:00:00 2016-08-10 14:00:00 2016-08-11 15:00:00 2016-08-12 16:00:00 2016-08-13 17:00:00 2016-08-14 18:00:00 Actual result: -------------- Output for 5.6.23 - 5.6.24, 7.0.8 - 7.1.0beta1 2016-08-01 13:00:00 2016-08-01 14:00:00 2016-08-01 14:00:00 2016-08-01 15:00:00 2016-08-01 16:00:00 2016-08-01 17:00:00 2016-08-07 18:00:00 Output for 5.6.0 - 5.6.22, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.7 2016-08-08 13:00:00 2016-08-09 14:00:00 2016-08-10 14:00:00 2016-08-11 15:00:00 2016-08-12 16:00:00 2016-08-13 17:00:00 2016-08-14 18:00:00 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72719&edit=1

« previous php.bugs (#202792) next »