Closed sebastienguay closed 3 years ago
I would just hide all uninterested months of the year and css the month to your needs.
var showMonth = new Date().getMonth()+1; // Show only current month
$('.calendar .month-container').each(function(idx, el){
if (idx != showMonth ) {
$(this).css("display", "none");
}
})
Good job! but the size of
Well yeah, that's where the css comes in handy, after all only you know how it should/must look like :)
var showMonth = new Date().getMonth()+1; // Show only current month
$('.calendar .month-container').each(function(idx, el){
if (idx != showMonth ) {
$(this).css("display", "none");
}
})
where does this code go?
Edit: Ok figured it out but.. I don't think it should be new Date().getMonth()+1;
rather it should be just new Date().getMonth()
It would be awesome if we could do something like this... I like the event adding part but changes in the calendar would be awesome..
Just to help fellow mates which might be dealing with same issues in the future. This code is pasted after calendar initialization. The code simply hides all months but the selected one(s). In this case you might be right, since indexing from each loop and getMonth() is both zero based :)
@anup756 : The functionality that you are looking for is not the goal of this calendar. The principal goal of this widget is to display a full year view. There is other calendars that propose this type of functionality (i.e. bootstrap calendar)
Oh ok cool
Edit: Honestly @Paul-DS I like your calendar better than the one you just posted :) Yours is just simple and easy to use, especially the events part. I'll figure out a way to just show the month.. :) Thanks though :+1:
Hi, nice job with this calendar, but like anup756 says, it would be awesome if we add the option to see only a particular month, more or less like the bootstrap calendar you posted.
Thanks !
I know this thread is pretty old, but I'm working on this feature in the new version of the library: js-year-calendar You can follow the development (and test the functionality) in the PR year-calendar/js-year-calendar#32
The feature is available in js-year-calendar@v2.0.0. Check the options startDate
and numberMonthsDisplayed
in the documentation
Is there a way to see only one month in big size like a zoom ?