Hi all,
fetching the UNIX date and showing it as readable date works so far. But: how do I display the months/days names in german? I couldn't find any hint in the variables shortcode reference.
Seems like I'm not the first to ask this. But ... so far, I couldn't find any answer in the forum.
Martin
fetching the UNIX date and showing it as readable date works so far. But: how do I display the months/days names in german? I couldn't find any hint in the variables shortcode reference.
Seems like I'm not the first to ask this. But ... so far, I couldn't find any answer in the forum.
Martin
Hi
In calendar Element, you can use Advanced settings/Translation/German.
In other case, use a PHP Element to translate.
In calendar Element, you can use Advanced settings/Translation/German.
In other case, use a PHP Element to translate.
Hi Colnem,
thanks so far. But ... I don't really know what you mean. Sorry.
It's not about a calendar, but a call of DB entries of JEvents.
What PHP element?
Martin
thanks so far. But ... I don't really know what you mean. Sorry.
It's not about a calendar, but a call of DB entries of JEvents.
What PHP element?
Martin
Sure this is for Chronforms 🙂
This is not a JEvents related issue. If you look here, you see how flawlessly one can use DB entries for (e.g.) JEvents in Chronoforms:
https://pdh.ch/index.php/de/agenda
And here, a slightly modified version in development also works fine:
https://dev3.marscom.ch/index.php/uebungen/abmeldungen
My only question is: how do I change the months and day names from english into german? The dates are - with CF {var: ...} converted from an UNIX timestamp. But I can't find out where and how to translate them.
Martin
This is not a JEvents related issue. If you look here, you see how flawlessly one can use DB entries for (e.g.) JEvents in Chronoforms:
https://pdh.ch/index.php/de/agenda
And here, a slightly modified version in development also works fine:
https://dev3.marscom.ch/index.php/uebungen/abmeldungen
My only question is: how do I change the months and day names from english into german? The dates are - with CF {var: ...} converted from an UNIX timestamp. But I can't find out where and how to translate them.
Martin
OK
In your case, you have to use PHP Element (in Action) or HTML Element using PHP (in Views) to translate months.
May be, using PHP function set_locale(). But I didn't try. Consult PHP Manual.
In your case, you have to use PHP Element (in Action) or HTML Element using PHP (in Views) to translate months.
May be, using PHP function set_locale(). But I didn't try. Consult PHP Manual.
Thanks,
but unfortunately, this has no effect (tried both options).
but unfortunately, this has no effect (tried both options).
Currently, this:
$current_day = JFactory::getDate('+0 seconds');Now I tried and tried with setlocale in different ways and as separate PHP before and after this action, as PHP in the pages view, but no change. The language won't change. I used "de-DE", "de_DE", "German_Standard" ... and so on.
$current_day = $current_day->toUnix();
$options = array();
$db =& JFactory::getDBO();
$query = "
SELECT
#__jevents_vevdetail.dtstart,
#__jevents_vevdetail.summary,
#__jevents_vevdetail.extra_info
FROM #__jevents_vevdetail
INNER JOIN #__jevents_vevent ON #__jevents_vevdetail.evdet_id = #__jevents_vevent.detail_id
WHERE
#__jevents_vevdetail.dtstart > " . $current_day ." AND
#__jevents_vevent.access = 1 AND
#__jevents_vevent.state >= 1
order by #__jevents_vevdetail.dtstart;
";
$db->setQuery($query);
return $db->loadAssocList();
foreach ( $data as $d )
{
$options[] = "<option value='{$d->summary}'>{$d->summary}</option>";
}
You need to login to be able to post a reply.