Internationlization of calendar

Gunter
Gunter
Offline
0
When you use this extension in a e.g. german joomla, the calendar month and day names are in english.
It uses the official joomla labels, so could be included in official build.
This can be fixed in fieldsbuilder.php:


private function BuildDynamicDateField(&$field)
{
// Beadsoft changes
$this->CreateDynamicStandardLabel($field);

$monthNames = array(JText::_('JANUARY'), JText::_('FEBRUARY'), JText::_('MARCH'), JText::_('APRIL'), JText::_('JUNE'), JText::_('JULY'), JText::_('AUGUST'), JText::_('SEPTEMBER'), JText::_('OCTOBER'), JText::_('NOVEMBER'), JText::_('DECEMBER'));
$dayNames = array(JText::_('SUN'), JText::_('MON'), JText::_('TUE'), JText::_('WED'), JText::_('THU'), JText::_('FRI'), JText::_('SAT'));



$result = ' // remove _ (only to post here)
var monthNames = [ ';
for ($i = 0; $i < count($monthNames); $i++) {
$result .= '"' . $monthNames[$i] . '"';
if ($i < count($monthNames)-1) $result .= ',';
}
$result .= ']; var dayNames = [ ';
for ($i = 0; $i < count($dayNames); $i++) {
$result .= '"' . $dayNames[$i] . '"';
if ($i < count($dayNames)-1) $result .= ',';
}
$result .= ']; var fromDate = new Date();
fromDate.setDate(fromDate.getDate() + 1); // tommorrow
var toDate = new Date();
toDate.setDate(fromDate.getDate() + 180); // max future date
jQuery(window).load(function()
{
j_Query("#' .$field->b2jFieldKey. '_'.$this->Application->owner . '").glDatePicker({ // remove _ from j_Query
cssName: "flatwhite",
monthNames: monthNames,
dowNames: dayNames,
dowOffset: 1,
allowMonthSelect: false,
allowYearSelect: false,
showAlways: false,
hideOnClick: true,
selectedDate: fromDate,
selectableDateRange: [ { from: fromDate, to: toDate }],
onClick: function(target, cell, date, data) {
target.val(date.getDate() + ". " +
monthNames[date.getMonth()] + " " +
date.getFullYear() + " (" + dayNames[date.getDay()] + ")"
);
}
});
});
// note keep original code from
Like
Responses (2)
Sorry, but you are not allowed to view the replies here.
Your Reply