Skip to content

Commit 91af554

Browse files
committed
changes from feedback
1 parent 81633ab commit 91af554

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

ext/calendar/dow.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,7 @@
3333
int DayOfWeek(
3434
zend_long sdn)
3535
{
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-
}
36+
return ((int)sdn % 7 + 8) % 7;
4437
}
4538

4639
const char * const DayNameShort[7] =

ext/calendar/tests/bug53574_2.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ array(9) {
2525
["year"]=>
2626
int(0)
2727
["dow"]=>
28-
int(3)
28+
int(1)
2929
["abbrevdayname"]=>
30-
string(3) "Wed"
30+
string(3) "Mon"
3131
["dayname"]=>
32-
string(9) "Wednesday"
32+
string(6) "Monday"
3333
["abbrevmonth"]=>
3434
string(0) ""
3535
["monthname"]=>

0 commit comments

Comments
 (0)