Kendo React带有波斯日历的DatetimePicker

时间:2019-05-30 19:20:14

标签: reactjs kendo-ui datetimepicker persian-calendar jalali-calendar

我阅读了关于全球化的kendo的this articlecldr document,发现我应该使用cldr-cal-persian-full在Kendo React DatetimePicker中实现波斯日历,但是下面的代码会导致错误, 无法读取未定义的属性'MM / dd / yyyy HH:mm:ss'“:

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;

剑道是否支持波斯日历?

0 个答案:

没有答案