简体   繁体   English

日期时间字段在 Alpaca.js 中不起作用

[英]Datetime field does not work in Alpaca.js

I have these scripts on my html page:我的 html 页面上有这些脚本:

<!-- alpaca.js datetime date -->
<script type="text/javascript" src="https://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>        
<script type="text/javascript" src="https://trentrichardson.com/examples/timepicker/jquery-ui-timepicker-addon.js"></script>
<link type="text/css" rel="stylesheet" href="https://trentrichardson.com/examples/timepicker/jquery-ui-timepicker-addon.css" />

And the code below assembles the alpaca form:下面的代码组装了羊驼毛形式:

$("#form").alpaca({    
    "schema": {
        "properties" : {
            "name": {
                "type":"string",
                "title":"Name",
                "required":true
             },
             "datetime": {
                 "title": "Datetime",
                 "description": "Pick your datetime.",
                 "format": "datetime"
             }
        }
    },
    "options": {
        "fields" : {
            "name": {
                "type" : "text",
                "size": 20            
            },
            "datetime": {
                "type": "datetime",
                "picker": {
                    "format": "DD/MM/YYYY HH:mm:ss"
                 },
                "manualEntry": true
            }
        }
    }
});

But the datetime field doesn't allow me to enter the date and time但是日期时间字段不允许我输入日期和时间

The calendar pop-up that appears is unconfigured, I can't even change the month, for example.出现的日历弹出窗口未配置,例如,我什至无法更改月份。

Do I need to do anything else for this datetime field to work properly?我需要为这个日期时间字段做任何其他事情才能正常工作吗?

I solved the problem by changing the scripts.我通过更改脚本解决了这个问题。

I accessed the showcase Alpaca page and I inspected the HTML我访问了展示羊驼页面并检查了 HTML

I discovered the scripts and I replaced them on my page.我发现了这些脚本,并在我的页面上替换了它们。

The scripts below:下面的脚本:

<!-- alpaca.js datetime date -->
<script type="text/javascript" src="http://www.alpacajs.org/lib/jquery-ui/jquery-ui.js"></script>
<link type="text/css" rel="stylesheet" href="http://www.alpacajs.org/lib/jquery-ui/themes/cupertino/jquery-ui.min.css" />
            
<script type="text/javascript" src="http://www.alpacajs.org/lib/jqueryui-timepicker-addon/dist/jquery-ui-timepicker-addon.js"></script>
<link type="text/css" rel="stylesheet" href="http://www.alpacajs.org/lib/jqueryui-timepicker-addon/dist/jquery-ui-timepicker-addon.css" />
    
<script type="text/javascript" src="http://www.alpacajs.org/lib/moment/min/moment-with-locales.min.js"></script>
<script type="text/javascript" src="http://www.alpacajs.org/lib/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
<link type="text/css" rel="stylesheet" href="http://www.alpacajs.org/lib/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM