反应数据网格自定义格式化程序是否同时使用自定义编辑器?

问题描述 投票:0回答:1

目标:目前使用反应数据网格,我想使用日期选择器(自定义编辑器)将用户输入保持在统一的MM / DD / YYYY中,并且用户浏览器区域设置(自定义格式化程序)中的格式是否可以实现。

(如果我以日期选择器格式转换,我可能需要修改后端。)

我做了一些关于这篇文章的研究Using react-datepicker in react-data-grid compoent格式化程序不能与编辑器一起工作吗?

这是我建造的演示:https://codesandbox.io/embed/8l4jkor19

到目前为止我无法使格式化程序工作。

class DateFormatter extends React.Component {
  render() {
    const browserLocale =
      window.navigator.userLanguage || window.navigator.language;
    console.log("browserLocale is: " + browserLocale);
    //{moment(this.props.value).local().locale(browserLocale).format('L')}
    return <div>{moment(value).format("L")}</div>;
  }
}

任何评论将不胜感激!

javascript reactjs semantic-ui-react react-data-grid
1个回答
1
投票

答案是肯定的

日历本地化+输入本地化

用React数据网格和Semantic ui日历做出反应

但是z zxswい

React-data-grid 6.1.0

Semantic-ui-calendar-react 0.14.4

Semantic-ui 0.84.0

© www.soinside.com 2019 - 2024. All rights reserved.