1

I want to disable the time picker in datetime picker.I am using some parameters like pickTime: false and format: "dd MM yyyy" .But no use..i'm using from this http://eonasdan.github.io/bootstrap-datetimepicker/

      <script type="text/javascript">
        $(function () {
            $('#datetimepicker1').datetimepicker();
             format: "dd MM yyyy" 
        });
    </script>

Plzz give a solution

robins
  • 1,668
  • 6
  • 33
  • 69

5 Answers5

1

You can pick date with

$('#datetimepicker1').val()

or

$('#datetimepicker1').data('date')

This only gives the date value

Possible Duplicate of How to get the value of the date using Bootstrap Datepicker

Community
  • 1
  • 1
Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85
1

You did some wrong in object passing into the function.

<script type="text/javascript">
    $(function () {
        $('#datetimepicker1').datetimepicker({
            format: "dd MM yyyy" 
        });      
    });
</script>
Al Amin Chayan
  • 2,460
  • 4
  • 23
  • 41
1

Better to use this to get only Date and you also have multiple Options with it

Have a look at this

Bootstrap DatePicker

Rajan Kali
  • 12,627
  • 3
  • 25
  • 37
1

It was your format string. 'yyyy' does not exist. It is 'YYYY' instead.

Also, dd would have gotten you the days like this: Su, Mo, Tu, ...

You probably wanted 01, 02, 03,...

Here's the documentation on the format:

http://momentjs.com/docs/#/displaying/format/

starblazer
  • 46
  • 2
1

Possible solution:

$('#datetimepicker4').datetimepicker({
    format: 'YYYY-MM-DD'
});

As answered by Celt in this post:

https://stackoverflow.com/a/28542910/2295862

Community
  • 1
  • 1
LionBass
  • 25
  • 1
  • 4