Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery DateTimePicker inline is showing blank data on first

Well I have a problem with displaying Datetimepicker from jquery-ui library. This is the code i am using for testing

<input id="datetimepicker3" type="text" />
<script type="text/javascript">
$(document).ready(function () {
    $(function () {
        $('#datetimepicker3').datetimepicker({
            format:'d.m.Y H:i',
            inline:true
        });
    });
});
</script>

Its working nice when i remove the inline:true, but when i add inline: true i face this problem the image.

image problem

It's empty or blank or not initialised, but when i click on any of the button such as the "home" button or as it called today button it works again and it shows the fields as in the next image. after a button click

How can i make it visible without clicking on anything ?! Thanks in advance.

Edit:

1- This is the fiddle : https://jsfiddle.net/9t4kgzuf/

2- Removing or adding $(document).ready(function () is the same result

like image 627
Yamen Nassif Avatar asked Mar 28 '26 02:03

Yamen Nassif


1 Answers

solved:

$(document).ready(function() {
  $(function() {
    $('#datetimepicker3').focus(function(){
        $('#datetimepicker3').datetimepicker({
        format: 'd.m.Y H:i',
        inline: true
      });
     });
  });
});
like image 199
Robert Blasco Villarroya Avatar answered Mar 29 '26 15:03

Robert Blasco Villarroya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!