Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Not sure how the inputs are working here, but you have next month and previous month. You can implement a counter variable that adds when you hit next and subtracts when you hit previous. So something like:</p> <pre><code>$i = 1; function datetracker() { if($nextbtnclicked = true) { $i++; } elseif($prevbtnclicked = true) { $i--; } if($i == 13) { $i = 1; $currentYear += 1; } } </code></pre> <p>I'm just using sample variables, but you can implement the counter in the Javascript and do the login in JS.</p> <p>EDIT: That code actually looks right. Don't know why it's not working, but try something like this.</p> <pre><code>function getMonthsSelect($name, $selectedMonth, $selectedYear, $month, $year, $deep, $attribs = '') { $months = array(1 =&gt; JText::_('January') , 2 =&gt; JText::_('February') , 3 =&gt; JText::_('March') , 4 =&gt; JText::_('April') , 5 =&gt; JText::_('May') , 6 =&gt; JText::_('June') , 7 =&gt; JText::_('July') , 8 =&gt; JText::_('August') , 9 =&gt; JText::_('September') , 10 =&gt; JText::_('October') , 11 =&gt; JText::_('November') , 12 =&gt; JText::_('December')); $stop = $month + $deep; $newyear = false; for ($i = $month; $i &lt; $stop; $i ++) { if($newyear) { $arr[] = JHTML::_('select.option', ($key = (! ($k = $i % 12) ? 12 : $k)) . ',' . ($y = (floor(($i - $month) / 12) + $year + 1)), ($months[$key] . '/' . $y)); $newyear = false; } else { $arr[] = JHTML::_('select.option', ($key = (! ($k = $i % 12) ? 12 : $k)) . ',' . ($y = (floor(($i - $month) / 12) + $year)), ($months[$key] . '/' . $y)); } if($i == 12) { $newyear = true; } } return JHTML::_('select.genericlist', $arr, $name, $attribs, 'value', 'text', $selectedMonth . ',' . $selectedYear); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload