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

[pickers] Add referenceDate prop on TimeClock, DigitalClock and MultiSectionDigitalClock #9356

Merged
merged 11 commits into from
Jun 30, 2023
Prev Previous commit
Next Next commit
Fix
  • Loading branch information
flaviendelangle committed Jun 19, 2023
commit b55ac2d87c23158c14b37d752d153bca305d73ad
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ export const SECTION_TYPE_GRANULARITY = {
};

export const getSectionTypeGranularity = (sections: FieldSection[]) =>
Math.max(...sections.map((section) => SECTION_TYPE_GRANULARITY[section.type] ?? 1));
Math.max(
...sections.map(
(section) =>
SECTION_TYPE_GRANULARITY[section.type as keyof typeof SECTION_TYPE_GRANULARITY] ?? 1,
),
);

export const getViewsGranularity = (views: readonly DateOrTimeView[]) =>
Math.max(...views.map((view) => SECTION_TYPE_GRANULARITY[view] ?? 1));
Expand Down