Hello,
Thanks for your answer, I am able to format the date, the issue is only with the "default" value, so I don't think there is a link between the two issues.
I am not using also JForm, the form is generated manually.
You said: "You should not be using % in the date formats I know that"
I am not sure about that, maybe in JForm but in Joomla 2.5, the function in libraries/joomla/html/html.php :
public static function calendar($value, $name, $id,
$format = '%Y-%m-%d', $attribs = null)
And my date format is correct, the calendar is generated 11-05-2012 and not %11-%05-%2012.
Just to clarify my issue:
$defaultdate= 11-05-2012;
echo JHTML::_('calendar', $defaultdate, "mydate", "mydate", "%m-%d-%Y", $options);
--> DateTime::__construct(): Failed to parse time string (11-05-2012) at position 0 (1): Unexpected character
The only solution currently is to set defaultdate = 2012-11-05 but in this case, the default value is not in the correct format.