Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ext/calendar/calendar.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static struct cal_entry_t cal_conversion_table[CAL_NUM_CALS] = {
#define JEWISH_HEB_MONTH_NAME(year) ((monthsPerYear[((year)-1) % 19] == 13)?JewishMonthHebNameLeap:JewishMonthHebName)

/* For jddayofweek */
enum { CAL_DOW_DAYNO, CAL_DOW_SHORT, CAL_DOW_LONG };
enum { CAL_DOW_DAYNO, CAL_DOW_LONG, CAL_DOW_SHORT };

/* For jdmonthname */
enum { CAL_MONTH_GREGORIAN_SHORT, CAL_MONTH_GREGORIAN_LONG,
Expand Down Expand Up @@ -694,10 +694,10 @@ PHP_FUNCTION(jddayofweek)
daynames = DayNameShort[day];

switch (mode) {
case CAL_DOW_SHORT:
case CAL_DOW_LONG:
RETURN_STRING(daynamel);
break;
case CAL_DOW_LONG:
case CAL_DOW_SHORT:
RETURN_STRING(daynames);
break;
case CAL_DOW_DAYNO:
Expand Down
2 changes: 1 addition & 1 deletion ext/calendar/tests/jddayofweek.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jddayofweek()
<?php
foreach (array(2440588, 2452162, 2453926, -1000) as $jd) {
echo "### JD $jd ###\n";
for ($mode = 0; $mode <= 2; $mode++) {
foreach (array(CAL_DOW_DAYNO, CAL_DOW_LONG, CAL_DOW_SHORT) as $mode) {
echo "--- mode $mode ---\n";
for ($offset = 0; $offset <= 7; $offset++) {
echo jddayofweek($jd + $offset, $mode). "\n";
Expand Down