【发布时间】:2019-06-04 17:12:45
【问题描述】:
我需要 d3 语言环境。
timeFormatDefaultLocale({
"dateTime": "%A, der %e. %B %Y, %X",
"date": "%d.%m.%Y",
"time": "%H:%M:%S",
"periods": ["AM", "PM"],
"days": ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"],
"shortDays": ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
"months": ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"],
"shortMonths": ["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"]
})
因此,如果我进行以下更改:
"shortDays": moment.weekdaysShort(),
我收到此错误:
Type 'string[]' is not assignable to type '[string, string, string, string, string, string, string]'.
Property '0' is missing in type 'string[]'.
任何帮助。为什么会出现这个错误?
【问题讨论】:
标签: javascript string typescript d3.js