I am using DateTimePicker 3 Bootstrap for my calendar in my project. I need to switch my datetimepicker view from 'month to date' or 'date to month' if I click some buttons. I tried using jQuery but it's not working at all. Please check if I made a mistake in the code.
My current markup and script code:
<script>
$(document).ready(function(){
$("#Month").click(function () {
$('#datetimepicker3').datetimepicker({
format: 'M-YYYY',
maxDate: 'now'
});
});
$("#Date").click(function () {
$('#datetimepicker3').datetimepicker({
format: 'DD-MM-YYYY',
maxDate: 'now'
});
});
});
</script>
<div class="form-group">
<div class='input-group date' id='datetimepicker3'>
<input type='text' class="form-control" name="date" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>
</div>
</div>