我如何使用theprovider造型材料daterangepicker?

发布于 2025-02-03 02:32:20 字数 1320 浏览 2 评论 0原文

我正在尝试设计超级派。我希望该元素显示黑暗模式,但仍显示光模式。

这是我正在使用的软件包: https://github.com/ jungsoft/材料 - daterange-picker/esloces/5

如果我尝试此叉子,它确实有效: https://github.com/nikhilgoud/nikhilgoud/materialialui-daterange-picker

但是还有另一个问题。残疾日期不会出现。

是否不可能以这种方式造型DateTangePicker?还是还有另一种样式的方式?

    const theme = createTheme({
        palette: {
            // Dark Mode
            mode: 'dark',
            primary: {
              main: "#0057FF"
            },
        },
    });

    return (
        <StyledEngineProvider injectFirst>
            <ThemeProvider theme={theme}>
                <DateRangePicker
                    open={open}
                    toggle={() => {toggle()}}
                    onChange={(dateRange) => {onChange(dateRange)}}
                    maxDate={new Date(Date.now())}
                    wrapperClassName="w-max"
                    initialDateRange={initialDateRange}
                    />
            </ThemeProvider>
        </StyledEngineProvider>
    )

I'm trying to style the DateRangePicker. I would expect the element to show the dark mode but it's still showing the light mode.

This is the package that I'm using: https://github.com/jungsoft/materialui-daterange-picker/issues/5

If I try this fork it does work:
https://github.com/nikhilgoud/materialui-daterange-picker

However that package has another problem. The disabled dates don't show up.

Is it not possible to style the DateRangePicker this way? Or Is there another way to style it?

    const theme = createTheme({
        palette: {
            // Dark Mode
            mode: 'dark',
            primary: {
              main: "#0057FF"
            },
        },
    });

    return (
        <StyledEngineProvider injectFirst>
            <ThemeProvider theme={theme}>
                <DateRangePicker
                    open={open}
                    toggle={() => {toggle()}}
                    onChange={(dateRange) => {onChange(dateRange)}}
                    maxDate={new Date(Date.now())}
                    wrapperClassName="w-max"
                    initialDateRange={initialDateRange}
                    />
            </ThemeProvider>
        </StyledEngineProvider>
    )

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

束缚m 2025-02-10 02:32:20

以防万一其他人仍在寻找答案。

面对同一问题,发现工作 fork

该软件包都可以拾取MUI主题播放器样式并正确显示残疾日期。

安装:

npm install mui-daterange-picker

或纱线

yarn add mui-daterange-picker

Just in case someone else is still looking for an answer.

Faced the same issue and found a working fork.

This package both picks up the MUI ThemeProvider styles and correctly displays disabled dates.

Installation:

npm install mui-daterange-picker

or with yarn

yarn add mui-daterange-picker
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文