<div id="year-nav-conainer">
{foreach $months as $year=>$month}
- <div data-year="{$year}" {if $year == $current_year} class="year-nav date-highlight" {else} class="year-nav"{/if}> {$year}</div>
+ <div data-year="{$year}" {if $year == $current_year} class="year-nav date-highlight current-date" {else} class="year-nav"{/if}> {$year}</div>
{/foreach}
</div>
<div id="month-nav-container">
{foreach $months[$current_year] as $month}
- <div data-month="{$current_year}-{$month.date}-01" {if $month.date == $current_month} class="month-nav date-highlight" {else} class="month-nav"{/if}> {$month.name} </div>
+ <div data-month="{$current_year}-{$month.date}-01" {if $month.date == $current_month} class="month-nav date-highlight current-date" {else} class="month-nav"{/if}> {$month.name} </div>
{/foreach}
</div>
<!-- Calendar -->
var view = '{$cal_view}';
var months = '{$json_months}';
var category = $('#glm-event-category').val();
+ var current_month = $('{$current_month}');
+ var current_year = $('{$current_year}');
months = JSON.parse(months);
var new_date = $(this).attr('data-month');
$('#eventCalendar').fullCalendar('gotoDate', new_date);
eventsCalMonthAJAX(month_obj);
+
});
$('.year-nav').on("click", function(){
$('.year-nav').removeClass("date-highlight");
$('#month-nav-container').empty();
$.each(new_months, function(index, value){
- {literal} var option = $('<div>', {class: 'month-nav',text: value.name}); {/literal}
+
+ if(value.date == current_month.selector){
+ {literal} var option = $('<div>', {class: 'month-nav date-highlight',text: value.name}); {/literal}
+ } else {
+ {literal} var option = $('<div>', {class: 'month-nav',text: value.name}); {/literal}
+ }
+
option.attr('data-month', year + '-' + value.date +'-01');
$('#month-nav-container').append(option);
});