Skip to content

Commit c3b44b1

Browse files
committed
Merge branch 'PHP-5.6'
* PHP-5.6: Fixes #67960 - Long/short day names reversed in jddayofweek() Conflicts: ext/calendar/calendar.c
2 parents 95e04fe + fe46966 commit c3b44b1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ext/calendar/calendar.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ static struct cal_entry_t cal_conversion_table[CAL_NUM_CALS] = {
208208
#define JEWISH_HEB_MONTH_NAME(year) ((monthsPerYear[((year)-1) % 19] == 13)?JewishMonthHebNameLeap:JewishMonthHebName)
209209

210210
/* For jddayofweek */
211-
enum { CAL_DOW_DAYNO, CAL_DOW_SHORT, CAL_DOW_LONG };
211+
enum { CAL_DOW_DAYNO, CAL_DOW_LONG, CAL_DOW_SHORT };
212212

213213
/* For jdmonthname */
214214
enum { CAL_MONTH_GREGORIAN_SHORT, CAL_MONTH_GREGORIAN_LONG,
@@ -694,10 +694,10 @@ PHP_FUNCTION(jddayofweek)
694694
daynames = DayNameShort[day];
695695

696696
switch (mode) {
697-
case CAL_DOW_SHORT:
697+
case CAL_DOW_LONG:
698698
RETURN_STRING(daynamel);
699699
break;
700-
case CAL_DOW_LONG:
700+
case CAL_DOW_SHORT:
701701
RETURN_STRING(daynames);
702702
break;
703703
case CAL_DOW_DAYNO:

ext/calendar/tests/jddayofweek.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jddayofweek()
66
<?php
77
foreach (array(2440588, 2452162, 2453926, -1000) as $jd) {
88
echo "### JD $jd ###\n";
9-
for ($mode = 0; $mode <= 2; $mode++) {
9+
foreach (array(CAL_DOW_DAYNO, CAL_DOW_LONG, CAL_DOW_SHORT) as $mode) {
1010
echo "--- mode $mode ---\n";
1111
for ($offset = 0; $offset <= 7; $offset++) {
1212
echo jddayofweek($jd + $offset, $mode). "\n";

0 commit comments

Comments
 (0)