原生质体日期选择器:具有不同日期时间格式的问题 [英] Protoplasm Date Picker : Issue with different datetime format

查看:104
本文介绍了原生质体日期选择器:具有不同日期时间格式的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一个有I18N支持的应用程序。在此应用程序中,根据用户的区域设置用户,提示输入日期时间与特定格式的区域设置以及表单中的其他详细信息。我们使用原生质日期时间选择器选择日期时间。



现在,我们面临特定日期时间格式的问题,插件显示错误的时间。这是html

 < html> 
< head>
< script language =javascriptsrc =protoplasm.js>< / script>
< script language =javascript>
// transform()调用可以链接在一起
Protoplasm.use('datepicker')
.transform('input.datepicker',{timePicker:true,use24hrs:false,dateTimeFormat: 'dd-MM-yyyy HH:mm a'})
.transform('input.datetimepicker')
;
< / script>
< / head>
< body>
< input type =textname =dateclass =datepicker/>
< / body>
< / html>

当用户点击插件上的PM框显示16-04-2012 22: 59 PM 而不是16-04-2012 10:59 PM 。但是如果他点击AM框就可以使用。



有没有人遇到过这样的问题?



请帮我解决这个问题。



感谢Amit Patel

解决方案

HH with hh in dateTimeFormat p>

I am working an application having I18N support. In this application, based on user's locale user is prompted enters date time in locale specific format along with other details in a form. We have used protoplasm date time picker to select date time.

Right now we are facing an issue with specific datetime format where the plugin shows wrong hours. Here is the html

<html>
    <head>
        <script language="javascript" src="protoplasm.js"></script>
        <script language="javascript">
            // transform() calls can be chained together
            Protoplasm.use('datepicker')
                .transform('input.datepicker', {timePicker:true, use24hrs:false, dateTimeFormat: 'dd-MM-yyyy HH:mm a'} )
                .transform('input.datetimepicker')
                ;
        </script>
    </head>
    <body>
        <input type="text" name="date" class="datepicker" />
    </body>
</html>

When user click on PM box on the plugin it shows 16-04-2012 22:59 PM instead of 16-04-2012 10:59 PM. However if he click on AM box it works.

Has anyone faced such issues?

Please help me to resolve this problem.

Thanks, Amit Patel

解决方案

I replaced HH with hh in dateTimeFormat and it worked.

这篇关于原生质体日期选择器:具有不同日期时间格式的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆