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

Allow for descending date range. #1681

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jaycarey
Copy link

@jaycarey jaycarey commented Mar 31, 2020

Reasons for making this change

Change to make the yearsRange option support descending values.

If this is related to existing tickets, include links to them as well.

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests
    • I've updated docs if needed
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

@epicfaace epicfaace added this to In progress in PRs May 23, 2020
PRs automation moved this from Todo to Review in progress Aug 9, 2022
Copy link
Contributor

@ahkhanjani ahkhanjani left a comment

Choose a reason for hiding this comment

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

Is this change still valid? If so please fix the code and make a PR for rjsf-v5 branch.

@@ -4,6 +4,9 @@ import PropTypes from "prop-types";
import { shouldRender, parseDateString, toDateString, pad } from "../../utils";

function rangeOptions(start, stop) {
if (start < 0) start = new Date().getFullYear() + start;
if (stop < 0) stop = new Date().getFullYear() + stop;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make this change:

if (stop < 0) {
  stop = new Date().getFullYear() + stop;
}

@heath-freenome heath-freenome added p1 Important to fix soon v5 refactor Needs refactor due to v5 breaking changes labels Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1 Important to fix soon v5 refactor Needs refactor due to v5 breaking changes
Projects
No open projects
PRs
  
Review in progress
Development

Successfully merging this pull request may close these issues.

None yet

3 participants