javascript - Datetimepicker doesn't use the given format -
i'm using date time picker of jquery, it's not using given format. instead of using that, uses it's default date format , gives error in console: uncaught typeerror: f.mask.replace not function
. error when lose focus of date time picker.
something, though, error right after page loaded: maximum call stack size exceeded
.
how make sure uses given format?
if need additional information, feel free ask.
html
<input id="start" value="01-01-2016" />
css
$('#start').datetimepicker({ formattime: 'h:i', formatdate: 'dd-mm-yy', defaultdate: '01-01-2016', defaulttime: '10:00' });
additional information
this date time picker code use. error (uncaught typeerror: f.mask.replace not function
) on line 1743.
this bug in master branch. already fixed, still exists in concatenated file jquery.datetimepicker.full.js. if not want use release versions, use file jquery.datetimepicker.js , add required dependencies:
if use bower, add dependencies here https://github.com/xdan/datetimepicker/blob/master/bower.json own bower.json:
"jquery": ">= 1.7.2", "jquery-mousewheel": ">= 3.1.13", "php-date-formatter": ">= 1.3.3"
or:
<link href="https://rawgit.com/xdan/datetimepicker/master/jquery.datetimepicker.css" type="text/css" rel="stylesheet"> <script src="https://code.jquery.com/jquery-2.2.2.min.js"></script> <script src="https://rawgit.com/jquery/jquery-mousewheel/master/jquery.mousewheel.min.js"></script> <script src="https://rawgit.com/kartik-v/php-date-formatter/master/js/php-date-formatter.min.js"></script> <script src="https://rawgit.com/xdan/datetimepicker/master/jquery.datetimepicker.js"></script> <input id="start" value="01-01-2016" /> <script> $( document ).ready(function() { $('#start').datetimepicker({ formattime: 'h:i', formatdate: 'dd-mm-yy', defaultdate: new date(2016,01,01), defaulttime: '10:00' }); }); </script>
Comments
Post a Comment