Skip to content

Commit

Permalink
loads en-GB language file and links to calendar objects
Browse files Browse the repository at this point in the history
  • Loading branch information
purplebeanie committed Aug 30, 2014
1 parent 073dcd1 commit f823ec9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions libraries/cms/html/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ public static function tooltipText($title = '', $content = '', $translate = 1, $
*
* @since 1.5
*/
public static function calendar($value, $name, $id, $format = 'yyy-mm-dd', $attribs = null)
public static function calendar($value, $name, $id, $format = 'yyyy-mm-dd', $attribs = null)
{
// Switch the format if needed. Existing Joomla calendar uses default format: %Y-%m-%d
$format = preg_replace(array('/\%Y/','/\%m/','/\%d/'),array('yyyy','mm','dd'),$format);
Expand All @@ -972,16 +972,21 @@ public static function calendar($value, $name, $id, $format = 'yyy-mm-dd', $attr
JHtml::_('script','calendars/jquery.calendars.plus.js', true, true);
JHtml::_('script','calendars/jquery.plugin.js', true, true);
JHtml::_('script','calendars/jquery.calendars.picker.js', true, true);
JHtml::_('stylesheet','calendars/jquery.calendars.picker.css',null, true);
JHtml::_('stylesheet','calendars/redmond.calendars.picker.css',null, true);
JHtml::_('stylesheet','calendars/joomla-css-fixes.css',null, true);
JHtml::_('stylesheet','calendars/jquery.calendars.picker.css', null, true);
JHtml::_('stylesheet','calendars/redmond.calendars.picker.css', null, true);
JHtml::_('stylesheet','calendars/joomla-css-fixes.css', null, true);

// Load localisation options
JHtml::_('script','calendars/jquery.calendars-en-GB.js', true, true);
JHtml::_('script','calendars/jquery.calendars.picker-en-GB.js', true, true);

// Setup the calendar
$doc = JFactory::getDocument();
$doc->addScriptDeclaration('jQuery(document).ready(function(){
jQuery("#' . $id . '").calendarsPicker({
dateFormat:"' . $format . '",
showTrigger: "<button type=\"button\" class=\"btn trigger\"><i class=\"icon-calendar\"></i></button>"
showTrigger: "<button type=\"button\" class=\"btn trigger\"><i class=\"icon-calendar\"></i></button>",
calendar: jQuery.calendars.instance(\'gregorian\',\'en-GB\')
}
);
});');
Expand Down

0 comments on commit f823ec9

Please sign in to comment.