?
avatar sakiss
sakiss
9 Dec 2015

This code produces an error

JHTML::calendar(
 '12-30-2015',
'something',
'something',
 '%m-%d-%Y'
);

This happens only with the date format %m-%d-%Y.
If you change the date format (e.g. %Y-%m-%d) and supply a date relative to that, works fine.

After some debugging i found out:
1. No matter what date is supplied the value becomes 01-01-1970
2. The error is generated by a code in the title of the text input

title="' . ($inputvalue ? static::_('date', $value, null, null) : '') 

file: libraries/cms/html/html.php
function: calendar
joomla version: 3.4.5

avatar sakiss sakiss - open - 9 Dec 2015
avatar Bakual
Bakual - comment - 9 Dec 2015

The $value needs to be always in english format (2015-12-30).
The $format may be a different non-english format. It specifies how the date will be displayed.

Closing as working as intended.

avatar Bakual Bakual - change - 9 Dec 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-12-09 19:38:19
Closed_By Bakual
avatar Bakual Bakual - close - 9 Dec 2015
avatar brianteeman brianteeman - close - 9 Dec 2015
avatar Bakual Bakual - close - 9 Dec 2015
avatar sakiss
sakiss - comment - 10 Dec 2015

Thanks!

avatar brianteeman brianteeman - change - 14 Dec 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment