Hi GreyHead,
After some long read i have found a solution.
I am working the values onchange on the form. So, Javascript and Mootools Datepicker. I am using Joomla 2.5
For the solution i have made this:
1. On advanced edit of form, DateTime Picker config. This will guarantee that value is recalculated if date changes.
onSelect: myfunction
2. In the "Load JS" action
- For the local code of calendar. This will give me Months and Week days in my language. If supported in the Mootools DatePicker. In my case is supported.
<?php
$lang =& JFactory::getLanguage();
$tag = $lang->getTag();
echo "Locale.use('{$tag}');";
?>
- For the months difference
function myfunction(){
start = $('calendar_box_id').value.split(' ')[0]; //Date Selected
start = new Date().parse(start); //Parse Date
today = new Date(); //Get Today Date
months = start.diff(today, 'month'); //Months difference from today to selected date
};
The purpose of this code is to calculate loans.
Hope will help someone else,🙂
Tks,
Renas