如何正确使用bootstrap datetimepicker语言环境选项

时间:2021-11-21 02:04:59

I would like how to use bootstrap datetimepicker locale option properly.

我想如何正确使用bootstrap datetimepicker locale选项。

Manual says

locale Default: moment.locale() Accepts: string, moment.local('locale') See momentjs for valid locales.

locale默认值:moment.locale()接受:string,moment.local('locale')有效区域设置请参见momentjs。

You must include moment-with-locales.js or a local js file.

您必须包含moment-with-locales.js或本地js文件。

I would like to include it.js.

我想包括it.js.

I have got this HTML but it doesn't apply custom language.

我有这个HTML但它不适用自定义语言。

<head runat="server">
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" />
    <link href="~/Content/bootstrap-datetimepicker.min.css" rel="stylesheet" />


    <script src="/Scripts/jquery-1.9.1.min.js"></script>
    <%--<script src="/Scripts/moment-with-locales.min.js"></script>--%>
    <script src="/Scripts/moment.min.js"></script>
    <script src="/Scripts/bootstrap.min.js"></script>
    <script src="/Scripts/bootstrap-datetimepicker.min.js"></script>
    <script src="/Scripts/it.js"></script>

</head>

So what do I have to do?

那我该怎么办?

Any clue?

1 个解决方案

#1


0  

I found a how to use it.

我找到了如何使用它。

$('.datepicker').datetimepicker({ locale: 'es' });

$('。datepicker')。datetimepicker({locale:'es'});

#1


0  

I found a how to use it.

我找到了如何使用它。

$('.datepicker').datetimepicker({ locale: 'es' });

$('。datepicker')。datetimepicker({locale:'es'});