We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81633ab commit 91af554Copy full SHA for 91af554
ext/calendar/dow.c
@@ -33,14 +33,7 @@
33
int DayOfWeek(
34
zend_long sdn)
35
{
36
- int dow;
37
-
38
- dow = (int)(sdn % 7 + 1);
39
- if (dow >= 0) {
40
- return (dow % 7);
41
- } else {
42
- return (dow + 7) % 7;
43
- }
+ return ((int)sdn % 7 + 8) % 7;
44
}
45
46
const char * const DayNameShort[7] =
ext/calendar/tests/bug53574_2.phpt
@@ -25,11 +25,11 @@ array(9) {
25
["year"]=>
26
int(0)
27
["dow"]=>
28
- int(3)
+ int(1)
29
["abbrevdayname"]=>
30
- string(3) "Wed"
+ string(3) "Mon"
31
["dayname"]=>
32
- string(9) "Wednesday"
+ string(6) "Monday"
["abbrevmonth"]=>
string(0) ""
["monthname"]=>
0 commit comments