Skip to content

Commit

Permalink
Merge pull request #803 from sebgroup/develop
Browse files Browse the repository at this point in the history
next release
  • Loading branch information
eweseong authored Feb 16, 2023
2 parents 50f09db + 34601ad commit 7b65e68
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"license": "Apache-2.0",
"dependencies": {
"@sebgroup/frontend-tools": "^2.2.1",
"@sebgroup/frontend-tools": "^2.2.2",
"browser-typescript-parser": "^2.6.7",
"classnames": "^2.3.1",
"gatsby": "^4.20.0",
Expand Down
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"license": "Apache-2.0",
"dependencies": {
"@sebgroup/frontend-tools": "^2.2.1",
"@sebgroup/frontend-tools": "^2.2.2",
"@types/body-scroll-lock": "^3.1.0",
"body-scroll-lock": "^4.0.0-beta.0",
"classnames": "^2.3.1",
Expand Down
2 changes: 2 additions & 0 deletions lib/src/Datepicker/Datepicker.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ describe("Component: Datepicker", () => {
expect(props.onChange).toHaveBeenLastCalledWith(null);
changeDate(`${minYear}-01-01`);
expect(props.onChange).toHaveBeenCalledTimes(9);
expect(props.onChange).not.toHaveBeenLastCalledWith(null);
changeDate(`${maxYear}-01-01`);
expect(props.onChange).toHaveBeenCalledTimes(10);
expect(props.onChange).not.toHaveBeenLastCalledWith(null);
});

it("should support fallback custom picker", async () => {
Expand Down
6 changes: 3 additions & 3 deletions lib/src/Datepicker/Datepicker.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isDateAfter } from "@sebgroup/frontend-tools";
import { isDateAfter, isSameDate } from "@sebgroup/frontend-tools";
import { isDateBefore } from "@sebgroup/frontend-tools/isDateBefore";
import { randomId } from "@sebgroup/frontend-tools/randomId";
import classnames from "classnames";
Expand Down Expand Up @@ -456,8 +456,8 @@ function hasModifierKey({ altKey, ctrlKey, metaKey, shiftKey }: React.KeyboardEv
}

function isDateInRange(d: Date, min: Date, max: Date): boolean {
const isAfterMinDate = !min || !isDateBefore(d, min);
const isBeforeMaxDate = !max || !isDateAfter(d, max);
const isAfterMinDate = !min || isDateAfter(d, min) || isSameDate(d, min);
const isBeforeMaxDate = !max || isDateBefore(d, max) || isSameDate(d, max);
return isAfterMinDate && isBeforeMaxDate;
}

Expand Down
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7b65e68

Please sign in to comment.