Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Calendar] new option autoAdjustDateEdges avoid invalid mindate/maxdate combinations #1366

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

lubber-de
Copy link
Member

Description

This PR adds a new setting autoAdjustDateEdges (default false to stay backward compatible)

When enabled and a call to set.minDate or set.maxDate would result in an invalid range (min > max or max < min) it will automatically set the opposite edge to the same value, so the range stays valid.

The current (and still default) behavior already fetches invalid values but only shows this in the log when debug and verbose is enabled, so fails silently. As this is rather an error than a verbose information i also changed the log level to error in those cases.

Testcase

https://jsfiddle.net/k386q42s/1/

Closes

#1364

@lubber-de lubber-de added type/feat Any feature requests or improvements lang/javascript Anything involving JavaScript state/awaiting-reviews Pull requests which are waiting for reviews state/awaiting-docs Pull requests which need doc changes/additions labels Mar 14, 2020
@lubber-de lubber-de added this to the 2.8.5 milestone Mar 14, 2020
exoego
exoego previously approved these changes Mar 15, 2020
Copy link
Contributor

@exoego exoego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lubber-de
Copy link
Member Author

@fomantic/maintainers Before reviewing, please take a look at the conversion in the original issue #1364 (comment)

ColinFrick
ColinFrick previously approved these changes Mar 25, 2020
@lubber-de lubber-de added the state/on-hold Issues and pull requests which are on hold for any reason label Apr 18, 2020
@y0hami y0hami modified the milestones: 2.8.5, 2.9.x Apr 24, 2020
@lubber-de lubber-de modified the milestones: 2.9.0, 2.9.x Nov 4, 2020
@lubber-de lubber-de removed the state/awaiting-reviews Pull requests which are waiting for reviews label Dec 24, 2020
# Conflicts:
#	src/definitions/modules/calendar.js
@lubber-de lubber-de dismissed stale reviews from ColinFrick and exoego via cd40b52 April 28, 2022 19:46
@lubber-de lubber-de modified the milestones: 2.9.1, 2.9.x Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/javascript Anything involving JavaScript state/awaiting-docs Pull requests which need doc changes/additions state/on-hold Issues and pull requests which are on hold for any reason type/feat Any feature requests or improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants