Skip to content

Added fixedWeeks flag#176

Merged
gpbl merged 1 commit intogpbl:masterfrom
fcsonline:feature/6-weeks
Jun 8, 2016
Merged

Added fixedWeeks flag#176
gpbl merged 1 commit intogpbl:masterfrom
fcsonline:feature/6-weeks

Conversation

@fcsonline
Copy link
Contributor

@fcsonline fcsonline commented Jun 6, 2016

Problem

If your calendar is in a container with other elements around and you move between months, the container resizes to the number of weeks shown and this can create an annoying effect.

Solution

Added fixedWeeks flag

With this new flag, the calendar will show always the same number of
weeks. Exactly 6, because is the maximum number of week that a month can
have.

You can see here an example with this flag enabled:

6weeks

@gpbl
Copy link
Owner

gpbl commented Jun 6, 2016

👋 @fcsonline

I guess this is a dup of #133 (see comment). Maybe I don't get it: what is the problem with setting the container's min-height?

@fcsonline
Copy link
Contributor Author

The problem is that for months with 4 or 5 weeks you'll see a weird empty space. With this you can ensure that the calendar will show data for them.

@fcsonline
Copy link
Contributor Author

I'm going to fix those eslint issues.

@gpbl
Copy link
Owner

gpbl commented Jun 6, 2016

However, for months having just four weeks, you would see two weeks more from the next month, which is also weird. I think such graphic glitches should not be handled by this component. How are other implementations handling with this?

@fcsonline
Copy link
Contributor Author

This flag is disabled by default. I mean, you will see those extra weeks only when you have this flag enabled. I won't be weird because is what people will expect. The problem is that those "graphic glitches" can only be handled by this component. An external wrapper can not do any trick to avoid blank spaces.

Was #133 trying to solve the same problem?

@gpbl
Copy link
Owner

gpbl commented Jun 7, 2016

Thanks for replying! Yes, in the OS X date picker I see this behavior implemented as well – so I changed my mind :) I never payed attention to this.

I'd call this prop fixedWeeks instead, or something else shorter than enableFixedAmountOfWeeks. (yes there's a enableOutsideDays, but that was a bad choice, may become deprecated soon). What do you think?

@fcsonline
Copy link
Contributor Author

Great! I'm going to change the flag name and fix those eslint errors. 👏

With this new flag, the calendar will show always the same number of
weeks. Exactly 6, because is the maximum number of week that a month can
have.
@fcsonline fcsonline changed the title Added enableFixedAmountOfWeeks flag Added fixedWeeks flag Jun 8, 2016
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling e3a4471 on fcsonline:feature/6-weeks into ec6795e on gpbl:master.

@gpbl gpbl merged commit fc72701 into gpbl:master Jun 8, 2016
@gpbl
Copy link
Owner

gpbl commented Jun 8, 2016

Awesome thanks

@fcsonline
Copy link
Contributor Author

👏 Thanks!

@fcsonline
Copy link
Contributor Author

Could you release it, please?

@gpbl
Copy link
Owner

gpbl commented Jun 8, 2016

I want first to update the docs and the examples :) While trying this prop, I wonder if fixedWeeks should automatically set enableOutsideDays to true. It doesn't make much sense to enable 6 weeks without displaying the outside days, does it?

@fcsonline
Copy link
Contributor Author

I was thinking about that during development. Maybe you want to avoid the graphic glitches but don't want to see outside days. Weird case indeed. I don't have a strong opinion about it.

@gpbl
Copy link
Owner

gpbl commented Jun 9, 2016

@fcsonline So my position here is to enable them. Outside days can always be disabled by setting the prop to false.

@fcsonline
Copy link
Contributor Author

So you mean to enable it if is undefined, right? 👌

@gpbl
Copy link
Owner

gpbl commented Jun 9, 2016

Uhm nope the default value for the prop is false :( We would mess the code just for an edge case that doesn't make sense anyway :) Release coming soon!

@fcsonline
Copy link
Contributor Author

Cool!

gpbl added a commit that referenced this pull request Jun 9, 2016
Add docs, fix behavior of outside days for fixedWeeks (#176)
@gpbl
Copy link
Owner

gpbl commented Jun 9, 2016

Published as v2.2.0! example

@fcsonline
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants