From:             
Operating system: 
PHP version:      5.3.5
Package:          Calendar related
Bug Type:         Bug
Bug description:cal_from_jd returns month = 6 when there is only one Adar

Description:
------------
cal_from_jd() returns 6 for Adar when there is only one Adar, (it should
return 7, since if there is only one Adar it's AdarII).



It also says "AdarI", which is wrong (it should be either "Adar" or at
least "AdarII").



Furthermore the cal_days_in_month() (correctly) only works with month 7,
and not 6 as returned by cal_from_jd.

Test script:
---------------
<?

print_r(cal_from_jd(2456005, CAL_JEWISH));

echo cal_days_in_month(CAL_JEWISH, 6, 5772) . "\n";

echo cal_days_in_month(CAL_JEWISH, 7, 5772) . "\n";

?>



Expected result:
----------------
The month in cal_from_jd should be 7.



The second two lines demonstrate how cal_days_in_month also expects the
month to be 7.

Actual result:
--------------
Array

(

    [date] => 6/24/5772

    [month] => 6

    [day] => 24

    [year] => 5772

    [dow] => 0

    [abbrevdayname] => Sun

    [dayname] => Sunday

    [abbrevmonth] => AdarI

    [monthname] => AdarI

)

0

29



-- 
Edit bug report at http://bugs.php.net/bug.php?id=54254&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=54254&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=54254&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=54254&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=54254&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=54254&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=54254&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=54254&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=54254&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=54254&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=54254&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=54254&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=54254&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=54254&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=54254&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54254&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54254&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=54254&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=54254&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=54254&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=54254&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=54254&r=mysqlcfg

Reply via email to