Protoplasm Date Picker : Issue with different datetime format

本秂侑毒 提交于 2019-12-13 00:17:40

问题


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


回答1:


I replaced HH with hh in dateTimeFormat and it worked.



来源:https://stackoverflow.com/questions/10509949/protoplasm-date-picker-issue-with-different-datetime-format

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!