Skip to content

Commit 244fc1e

Browse files
fisharebestTyrael
authored andcommitted
Fixes #67960 - Long/short day names reversed in jddayofweek()
1 parent 99162b8 commit 244fc1e

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,
@@ -696,10 +696,10 @@ PHP_FUNCTION(jddayofweek)
696696
daynames = DayNameShort[day];
697697

698698
switch (mode) {
699-
case CAL_DOW_SHORT:
699+
case CAL_DOW_LONG:
700700
RETURN_STRING(daynamel, 1);
701701
break;
702-
case CAL_DOW_LONG:
702+
case CAL_DOW_SHORT:
703703
RETURN_STRING(daynames, 1);
704704
break;
705705
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)