1

我阅读了这篇关于全球化和cldr文档的剑道文章,发现我应该使用cldr-cal-persian-full在Kendo React DatetimePicker中实现波斯日历,但是我下面的代码会导致错误“无法读取属性'MM/dd /yyyy HH:mm:ss' of undefined ":

import React, { Component } from "react";

import { DateTimePicker } from "@progress/kendo-react-dateinputs";
import {
IntlProvider,
load,
loadMessages,
LocalizationProvider
} from "@progress/kendo-react-intl";

import likelySubtags from "cldr-core/supplemental/likelySubtags.json";
import currencyData from "cldr-core/supplemental/currencyData.json";
import weekData from "cldr-core/supplemental/weekData.json";

import numbers from "cldr-numbers-full/main/fa/numbers.json";

import caPersian from "cldr-cal-persian-full/main/fa/ca-persian.json";

import dateFields from "cldr-dates-full/main/fa/dateFields.json";
import timeZoneNames from "cldr-dates-full/main/fa/timeZoneNames.json";
import faMessages from "../data/fa.json";

load(
likelySubtags,
currencyData,
weekData,
numbers,
caPersian,
dateFields,
timeZoneNames
);

loadMessages(faMessages, "fa");

class KendoDatetime extends Component {
state = { locale: "fa" };
render() {
    return (
    <LocalizationProvider language={this.state.locale}>
        <IntlProvider locale={this.state.locale}>
        <div className="example-wrapper row">
            <div className="col-xs-12 col-md-12 example-config">
            <h5>
                Current local - <em>{this.state.locale}</em>
            </h5>
            </div>
            <div className="col-xs-12 col-md-6 example-col">
            <DateTimePicker />
            </div>
        </div>
        </IntlProvider>
    </LocalizationProvider>
    );
}
}

export default KendoDatetime;

剑道支持波斯历吗?

4

0 回答 0