Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0a4

Request #10946 Date_Calc::dateFormat should default to DATE_CALC_FORMAT
Submitted: 2007-05-06 09:27 UTC
From: doconnor Assigned:
Status: Open Package: Date (version 1.4.7)
PHP Version: 5.2.1 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2007-05-06 09:27 UTC] doconnor (Daniel O'Connor)
Description: ------------ If I do: $formattedDate = Date_Calc::dateFormat(1, 1, 2007); I get a blank string, which I would not expect, considering 99% of the other functions default to using DATE_CALC_FORMAT examples: function beginOfMonth($month = 0, $year = 0, $format = DATE_CALC_FORMAT) function dateNow($format = DATE_CALC_FORMAT) function daysToDate($days, $format = DATE_CALC_FORMAT) function getCalendarYear($year = 0, $format = DATE_CALC_FORMAT) Test script: --------------- require_once 'Date/Calc.php'; var_dump(Date_Calc::dateFormat(1,1,2007)); Expected result: ---------------- 20070101 Actual result: -------------- empty string

Comments

 [2007-11-06 12:13 UTC] c01234 (Chuckie Chuck)
On the other hand, you do also get Warning: Missing argument 4 for Date_Calc::dateFormat(), called in ... and defined in C:\dev\CVS\pear\Date\Date\Calc.php on line 137 Notice: Undefined variable: format in C:\dev\CVS\pear\Date\Date\Calc.php on line 147 so it's not a major problem