DateControl format for different countries

Hello,

Is there a way to let the date control (for example the birthdate on join form) display the date in a correct date format based on the selected language? some examples i would like to have

english: 05-31-1970

german: 31.05.1970

currently it shows in ISO 8601 (1970-05-31) which nobody likes to read.

 

Another question, can this control be localized so month names are not always english?

Check my GeoDistance, Watermark, TorBlock and Android Push Notifications mods | http://goo.gl/H3Vp81
Quote · 2 May 2012

This is made with the datepicker of jquery. I already tried to localize with my own ui.datepicker-de.js, but its not being recognized.

So i checked more where it gets initialized. Looks like Boonex calls it in inc/classes/BxDolForm.php and there is also some code to check for the languages, but honestly, i don't understand what is being done there

        $aCss = array(
            'forms_adv.css',
            'plugins/jquery/themes/|calendar-blue.css',
            'plugins/jquery/themes/|ui.datepicker.css'
        );
        $aCalendarLangs = array ('en' => 1, 'af' => 1, 'al' => 1, 'bg' => 1, 'br' => 1, 'ca' => 1, 'cs' => 1, 'da' => 1, 'de' => 1, 'du' => 1, 'el' => 1, 'es' => 1, 'fi' => 1, 'fr' => 1, 'he' => 1, 'hr' =$
        $aJs = array(
            'jquery.dynDateTime.js',
            'plugins/jquery/langs/|calendar-' . (isset($aCalendarLangs[$GLOBALS['sCurrentLanguage']]) ? $GLOBALS['sCurrentLanguage'] : 'en') . '.js',
            'ui.core.js',
            'ui.slider.js',
            'ui.datepicker.js'
        );

        if(isset($GLOBALS['oSysTemplate'])) {
            $GLOBALS['oSysTemplate']->addJs($aJs);
            $GLOBALS['oSysTemplate']->addCss($aCss);
        }
        if(isset($GLOBALS['oAdmTemplate'])) {
            $GLOBALS['oAdmTemplate']->addJs($aJs);
            $GLOBALS['oAdmTemplate']->addCss($aCss);
        }

I even tried to force it to "-de" but its not working, it is always in english. How i can init the control to use the browser language or the default index page language?

Maybe i have to put it in a header where the java script is being written to? Someone from boonex can tell me where i can switch the language based on the browser lang? I want german users have a german date picker control and all others a english one.

Check my GeoDistance, Watermark, TorBlock and Android Push Notifications mods | http://goo.gl/H3Vp81
Quote · 3 May 2012

Here is similar thread:

http://www.boonex.com/forums/topic/Pop-Up-Calendar-Does-Not-Work-In-Add-Events.htm

Rules → http://www.boonex.com/terms
Quote · 10 May 2012

Thank you so much,

the code information you posted was exactly what i was searching for. Now it works :)

Check my GeoDistance, Watermark, TorBlock and Android Push Notifications mods | http://goo.gl/H3Vp81
Quote · 10 May 2012

Thank you for the feedback.

Rules → http://www.boonex.com/terms
Quote · 13 May 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.