Executing a call to date_days(true, 6, 2009) causes the PHP warning:
Warning: date_format() expects parameter 1 to be DateTime, string given in ..../date/date_api.module on line 279
Followed by an array of integers 1-31 no matter what month is specified.
Comments
Comment #1
buddaThe correct parameters for the date_format() call is 'string date_format ( DateTime $object , string $format )' (http://uk2.php.net/manual/en/datetime.format.php)
The date_api.module is passing a string "2009-6-01 00:00:00" as argument 2. it looks like the parameters are the wrong way round too?
Current:
The format should be argument 2.
Comment #2
buddaFixed function involves wedging a
$datetime = date_create($date);in there.Somebody care to make a patch?
Comment #3
arlinsandbulte commentedComment #4
haggins commentedThis bug is still in the latest release. Without fix the function does not return the correct result.
Are there any reasons why you set status to "won't fix", arlinsandbulte?
Comment #5
iongion commentedWhy isn't this fixed, it is just a parameters switch, change from:
date_format('t', $date);to
date_format($date, 't');Comment #6
damienmckennaUnfortunately the Drupal 6 version of the Date module is no longer supported. That said, we appreciate that you took time to work on this issue. Should this request still be relevant for Drupal 7 please feel free to reopen it. Thank you.
Comment #7
budda9 years pass and still it never got fixed. Crazy.