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

[datetime2] feat: DateRangeInput3 using react-day-picker v8 #6390

Merged
merged 8 commits into from
Sep 19, 2023

Conversation

adidahiya
Copy link
Contributor

@adidahiya adidahiya commented Sep 18, 2023

Related to #5652, #5699 - necessary to unblock React 18 support

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

Add new "v3" variant of DateRangeInput which uses react-day-picker v8 via DateRangePicker3 (#6375)

Reviewers should focus on:

  • No regressions compared to DateRangeInput
  • Test coverage
  • Documentation

Screenshot

image image
Screen.Recording.2023-09-18.at.11.47.53.PM.mov

@adidahiya
Copy link
Contributor Author

fix lint

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya
Copy link
Contributor Author

fix formatting

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya adidahiya marked this pull request as ready for review September 19, 2023 13:35
@adidahiya
Copy link
Contributor Author

improve class naming pattern

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

Copy link
Contributor Author

@adidahiya adidahiya left a comment

Choose a reason for hiding this comment

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

self-review


import type { DateInput3Props } from "./dateInput3Props";

export function getFormattedDateString(
Copy link
Contributor Author

@adidahiya adidahiya Sep 19, 2023

Choose a reason for hiding this comment

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

this was unnecessarily copied from @blueprintjs/datetime; we now use it directly in @blueprintjs/datetime2 via the DatePickerUtils import

/** Props shared between DateRangeInput v1 and v3 */
type DateRangeInputSharedProps = Omit<DateRangeInputProps, "dayPickerProps" | "locale" | "localeUtils" | "modifiers">;

export type DateRangeInput3Props = DateRangeInputSharedProps & Pick<DateRangePicker3Props, "dayPickerProps" | "locale">;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this file is quite similar to dateInput3Props.ts, we might consider DRYing the two type implementations at some point (not in this PR though)

placement="bottom-start"
{...popoverProps}
autoFocus={false}
className={classNames(Classes.DATE_RANGE_INPUT, popoverProps.className, this.props.className)}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

nit: consider using { Classes as DatetimeClasses } from "@blueprintjs/datetime" import here, to make it more clear that this is a datetime "v1" class name

Suggested change
className={classNames(Classes.DATE_RANGE_INPUT, popoverProps.className, this.props.className)}
className={classNames(DatetimeClasses.DATE_RANGE_INPUT, popoverProps.className, this.props.className)}

@adidahiya adidahiya merged commit b4868ce into develop Sep 19, 2023
@adidahiya adidahiya deleted the ad/date-range-input3 branch September 19, 2023 13:52
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.

1 participant