EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: akashana on March 09, 2020, 12:54:34 AM



Title: Suppress unnecessary row of dates from last month in Calendar
Post by: akashana on March 09, 2020, 12:54:34 AM
Hello,

For the month of March 2020, the calendar control is showing unnecessary row of dates from last month i.e. 23-29th Feb. Please see attached image. How to suppress that row ?

Thanks,


Title: Re: Suppress unnecessary row of dates from last month in Calendar
Post by: jahangir on March 09, 2020, 10:04:32 PM
use following css.

Code:
.calendar-other-month{	
visibility: hidden;
}


http://code.reloado.com/jbhatti/23/edit#html,live


Title: Re: Suppress unnecessary row of dates from last month in Calendar
Post by: akashana on March 10, 2020, 10:08:55 PM
Thanks but then it displays one blank row for March 2020. Any solution to hide this blank row ?


Title: Re: Suppress unnecessary row of dates from last month in Calendar
Post by: jahangir on March 10, 2020, 11:54:25 PM
Try this.

Code:
<div id="c1" class="easyui-calendar" style="width:250px;height:250px;"></div> 

Code:
.calendar-other-month{	
visibility: hidden;
}

Code:
$('#c1').calendar({
onNavigate: function(year,month){   
if($("#c1").find("tr.calendar-first").find(".calendar-last").css("visibility") == 'hidden'){
$("#c1").find("tr.calendar-first").css("display","none");
}
if($("#c1").find("tr.calendar-last").find(".calendar-first").css("visibility") == 'hidden'){
$("#c1").find("tr.calendar-last").css("display","none");
}
}
});



http://code.reloado.com/jbhatti/24/edit


Title: Re: Suppress unnecessary row of dates from last month in Calendar
Post by: akashana on March 13, 2020, 03:14:58 AM
Great ! Thanks a ton.