reactjs - 从 DateInput BlueprintJS 更改月份名称

所以我正在使用 BlueprintJS datetime在 React 项目中打包以呈现生日选择器,我想将选择的月份名称设置为西类牙语版本。在他们的文档中说他们使用 react-day-picker为了呈现日历和从 react-day-picker 文档中有一个参数来设置数组中的月份名称,但我没有得到它来更改选择名称。这是我在组件中设置的。 weekdaysLongweekdaysShort 可以正常工作,但 months 属性不行。

<DateInput
      formatDate={date => date.toLocaleString('es-ES', {year: "numeric", month: "2-digit", day: "numeric"})}
      onChange={this.handleDateChange}
      parseDate => new Date(str)}
      placeholder={"DD/MM/YYYY"}
      maxDate={now}
      minDate={minDate}
      value={this.state.date}
      dayPickerProps={{
            locale: 'es',
            months: DateFormatString.months,
            weekdaysLong: DateFormatString.weekDaysLong,
            weekdaysShort: DateFormatString.weekDaysShort,
            firstDayOfWeek: 1,
      }}
/>

这是我有 monthsweekdays

的变量
const DateFormatString = {
  months: [
    'Enero',
    'Febrero',
    'Marzo',
    'Abril',
    'Mayo',
    'Junio',
    'Julio',
    'Agosto',
    'Septiembre',
    'Octubre',
    'Noviembre',
    'Diciembre'
  ],
  weekDaysLong: [
    'Domingo',
    'Lunes',
    'Martes',
    'Miercoles',
    'Jueves',
    'Viernes',
    'Sabado'
  ],
  weekDaysShort: [
    'Do',
    'Lu',
    'Ma',
    'Mi',
    'Ju',
    'Vi',
    'Sa'
  ]
}

有人知道发生了什么或知道另一种设置整个组件语言的方法吗?

最佳答案

根据这个 github 问题页面,这似乎是最近打开(并很快修复)的问题:https://github.com/palantir/blueprint/issues/3265

您可以等待修复被合并(然后更新您的 package.json 以使用新版本),或者您必须使用其他一些库。希望对您有所帮助!

https://stackoverflow.com/questions/54198249/

相关文章:

python - gremlin-python : what is a valid vertex c

r - 使用 R 中的 DBI 和 ActiveDirectoryPassword 身份验证连接到

azure - 确定特定 SessionId 的 Azure 服务总线队列上有多少消息

performance - Html-Webpack-Plugin 在多个 pug 文件上非常慢

sql-server - 来自 Azure 网站的 Azure VM SQL Server Inte

azure - AADSTS50011 : The reply url specified in t

sql - Presto SQL 窗口聚合回顾 x 小时/分钟/秒

php - 如何为 Composer 创建分支别名并使用它?

reactjs - 用于 Web 的 React 向上滑动面板

laravel - 错误 "Installation failed, reverting ./com