Forums

Configure datepicker for Dutch language

Dutch 24 Apr, 2011
Hi all,

I have used Chronoforms for Joomla 1.5 sites quite often. Now I am building my first Joomla 1.6 website with the ChronoForms V4 RC1.8 component. I am having some problems with the configuration/localization of the date picker for Dutch language.

To have my datepicker in Dutch (for names of months and days), I used to include this line in Date Fields extras to have a calendar in Dutch and to prevent a date selection in the past
classes: ['dashboard'], months: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december' ], days: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], direction: 0.5, offset: 1


The same code doesn't work for ChronoForms Version 4 for Joomla 1.6. I did some research on this forum and also found a tutorial on how to configure the date picker, but I do not have a clue how to do this.

I would appreciate your help on this!!
GreyHead 25 Apr, 2011
Hi Dutch,

You should be able to do it with
my_datepicker_class::{months: [months: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december' ], days: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag']}
in the "DateTime Picker selector" box on the Form Editor.

There are messy little bugs in the Date Picker implementation at the moment and I don't know if this will work - worth a try though.

Bob
Dutch 25 Apr, 2011
Hi Bob,

Thanks a lot for your reply. Unfortunately it is not working. I saw that you use [code]{months: [months: ['januari',[/code] but for the days you use [code]days: ['zondag',[/code]instead of maybe [code]{days: [days: ['zondag'[/code]

Anyway, I tried this one. In this case the calendar does show up but still in English:
cf_date_picker::{months: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december' ], days: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag']}


Then I tried this, but in this case the calendar doesn't show up at all:
cf_date_picker::{months: [months: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december' ], days: [days: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag']}


Maybe we miss some {} or [] somewhere I don't know, tried several combinations, and emptied some espressos, but no calendar.
GreyHead 25 Apr, 2011
Hi Dutch,

Sorry that was my typo with the months. I think this version of yours is correct:
cf_date_picker::{months: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december' ], days: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag']}

I spent several hours on Saturday fighting the datepicker configuration with little success.

I'll try again this afternoon.

Bob
Dutch 25 Apr, 2011
Hi Bob,

Obviously the datepicker changed a lot for this version of ChronoForms.

The code you proposed in your last post didn't work either. I see a calendar, but still in English. I even doubted if the field DateTime Picker selector and my calendar were linked, so to check this I removed a "{" from the code, and fortunately the calendar did not show up anymore, so I concluded there is a link between the code and the actual calendar (stupid test maybe, but in situations like this you sometimes think the impossible is possible :? )

But somehow the code in DateTime Picker selector is not able or is not allowed to modify the names of the months and days. Could this be a permissions issue? I am currently developing on a localhost (XAMPP for Windows 7 Pro)
GreyHead 25 Apr, 2011
Hi Dutch,

I don't think that it's a permissions issue; just that the code that Max wrote to handle this doesn't quite work the way he intended. See items e, f, & g in this post

Bob
GreyHead 25 Apr, 2011
Hi Dutch,

The good news is that I have found fixes for the bugs and got this working. The bad news is that it's going to take me until tomorrow to write up the fixes and post them.

Bob

[attachment=0]25-04-2011 21-14-28.png[/attachment]
Dutch 25 Apr, 2011
Hi Bob,

That sounds great! I am not in a hurry at all. The site that I am actually working on is a rewrite of a live static site that I want to migrate to a Joomla 1.6 platform within the next few weeks.

I wait for the good news tomorrow 😀

Marc
Dutch 26 Apr, 2011
Hi Bob,

I implemented these fixes in V4 for Joomla 1.6.

The fix in administrator/components/com_chronoforms/form_actions/show_html/cfaction_show_html.php gives a fatal error:
Fatal error: Call to a member function isSite() on a non-object in C:\xampp\htdocs\intranet\joomla16\administrator\components\com_chronoforms\form_actions\show_html\cfaction_show_html.php on line 197

I am not really (really not) a scripting specialist, so I do not know what goes wrong here.

Marc
GreyHead 26 Apr, 2011
Hi Marc,

The fix for the Joomla! 1.6 error you are seeing is to replace the first few lines of the function with this code:
	function _loadDatePickerScripts($form)
	{
		$document =& JFactory::getDocument();
		JHTML::_('behavior.mootools');
		$mainframe =& JFactory::getApplication();;
		$document->addStyleSheet(JURI::root().'components/com_chronoforms/css/datepicker/datepicker_dashboard.css');
		$document->addScript(JURI::root().'components/com_chronoforms/js/datepicker/datepicker.js');
		$datetime_array = array(

However, testing on the latest Joomla! 1.6.3 with Mootools 1.3 the datepicker script no longer seems to work at all :-( I see that there is a fork on MooTools Forge that is 1.3 compatible and looks as though it has other fixes as well http://mootools.net/forge/p/mootools_datepicker

I'll try installing that version later.

Bob
Dutch 27 Apr, 2011
Hi Bob,

Thanks for your research. Regarding your last post, I haven't been able to test it yet. I am actually on the road, and implementing source code with a smartphone is not easy :-)

I'll get back to you later, probably tomorrow.

Marc
Dutch 29 Apr, 2011
Hi Bob,

I inserted the code for Joomla 1.6. No more fatal errors, calendar back, but still in English. But I am using Joomla version 1.6.3, so I probably encounter the problem with MooTools 1.3.

Is there any easy way I could implement the MooTools datepicker fork myself? I guess it will be complicated 😟

Marc
Max_admin 31 May, 2011
Hi Marc,

These issues should be fixed in RC1.9, along with a new date picker loader action for full customization.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Dutch 31 May, 2011
Hi Max,

Thanks for your reply. I will wait for the next release.

For the time being I am using the workaround you proposed here, using a textfield with class datetime instead. Works for translations into Dutch.

But I am still looking for a possibility to start the datepicker on todays date. Not urgent, but NTH.

Regards,
Marc
GreyHead 01 Jun, 2011
Hi Marc,

CFv4 RC1.9 is already released. Please upgrade and test when you are ready.

Bob
This topic is locked and no more replies can be posted.