Skip to content

Commit

Permalink
Merge c09594a into 03ca21b
Browse files Browse the repository at this point in the history
  • Loading branch information
KenAJoh authored Jan 31, 2024
2 parents 03ca21b + c09594a commit 3d452c1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/stale-dogs-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-react": patch
---

DatePicker: Knapper fikk ikke riktig aria-label
2 changes: 0 additions & 2 deletions @navikt/core/react/src/date/datepicker/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { DateWrapper } from "../parts/DateWrapper";
import { getLocaleFromString, labels } from "../utils";
import DatePickerStandalone from "./DatePickerStandalone";
import Caption from "./parts/Caption";
import DayButton from "./parts/DayButton";
import DropdownCaption from "./parts/DropdownCaption";
import { HeadRow } from "./parts/HeadRow";
import Row from "./parts/Row";
Expand Down Expand Up @@ -124,7 +123,6 @@ export const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(
HeadRow,
WeekNumber,
Row,
Day: DayButton,
}}
className={cl("navds-date", className)}
classNames={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { DateRange, DayPicker, isMatch } from "react-day-picker";
import { omit } from "../../util";
import { getLocaleFromString, labels } from "../utils";
import Caption from "./parts/Caption";
import DayButton from "./parts/DayButton";
import DropdownCaption from "./parts/DropdownCaption";
import { HeadRow } from "./parts/HeadRow";
import Row from "./parts/Row";
Expand Down Expand Up @@ -94,7 +93,6 @@ export const DatePickerStandalone: DatePickerStandaloneType = forwardRef<
HeadRow,
WeekNumber,
Row,
Day: DayButton,
}}
className="navds-date"
classNames={{ vhidden: "navds-sr-only" }}
Expand Down
8 changes: 4 additions & 4 deletions @navikt/core/react/src/date/datepicker/datepicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export const Default: StoryObj<DefaultStoryProps> = {
const [open, setOpen] = useState(false);

const rangeCtx = useRangeDatepicker({
fromDate: new Date("Aug 23 2020"),
toDate: new Date("Aug 23 2023"),
fromDate: new Date("Aug 23 2023"),
toDate: new Date("Aug 23 2029"),
});

const singleCtx = useDatepicker({
fromDate: new Date("Aug 23 2020"),
toDate: new Date("Aug 23 2023"),
toDate: new Date("Aug 23 2029"),
});

const newProps = {
Expand All @@ -42,7 +42,7 @@ export const Default: StoryObj<DefaultStoryProps> = {
open,
onClose: () => setOpen(false),
fromDate: new Date("Aug 23 2020"),
toDate: new Date("Aug 23 2023"),
toDate: new Date("Aug 23 2029"),
}
: {}),
};
Expand Down
5 changes: 3 additions & 2 deletions @navikt/core/react/src/date/datepicker/parts/Row.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { getUnixTime } from "date-fns";
import React from "react";
import { Day, useDayPicker } from "react-day-picker";
import { useDayPicker } from "react-day-picker";
import { Hide } from "../../../layout/responsive";
import DayButton from "./DayButton";
import WeekNumber from "./WeekNumber";

/**
Expand Down Expand Up @@ -37,7 +38,7 @@ function Row(props: RowProps): JSX.Element {
style={styles.cell}
key={getUnixTime(date)}
>
<Day displayMonth={props.displayMonth} date={date} />
<DayButton displayMonth={props.displayMonth} date={date} />
</td>
))}
</tr>
Expand Down

0 comments on commit 3d452c1

Please sign in to comment.