Paul-DS / bootstrap-year-calendar

[DEPRECATED] A fully customizable year calendar widget, for boostrap !
Apache License 2.0
293 stars 244 forks source link

zoom a month #19

Closed sebastienguay closed 3 years ago

sebastienguay commented 8 years ago

Is there a way to see only one month in big size like a zoom ?

krizajb commented 8 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");
    }
 })
sebastienguay commented 8 years ago

Good job! but the size of is the same. So small, not big like a zoom

krizajb commented 8 years ago

Well yeah, that's where the css comes in handy, after all only you know how it should/must look like :)

comwiz756 commented 8 years ago
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()

comwiz756 commented 8 years ago

captureaa capturaaecapturey

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..

krizajb commented 8 years ago

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 :)

Paul-DS commented 8 years ago

@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)

comwiz756 commented 8 years ago

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:

jcorreia commented 8 years ago

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 !

Paul-DS commented 4 years ago

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

Paul-DS commented 3 years ago

The feature is available in js-year-calendar@v2.0.0. Check the options startDate and numberMonthsDisplayed in the documentation