How to Change View Mode in Bootstrap Datepicker Like yyyy-mm?

By Hardik Savani June 7, 2023 Category : Bootstrap

When i was working on my laravel application and i need use datepicker picker but i require only select year and month because i have to filter with onlt selected month and year. I did search lot and also check options of datepicker js but i can't do it that because i was wrong maybe.

But at last found minViewMode option of datepicker library and i did that if you also want to make format like mm-yyyy or yyyy-mm then you can set minviewmode this way :


<html lang="en">


<title>Bootstrap - datepicker change view mode like yyyy-mm</title>

<link href="" rel="stylesheet">

<link href="" rel="stylesheet">

<script src=""></script>

<script src=""></script>

<script src=""></script>



<div class="container text-center">

<h2>Bootstrap - datepicker change view mode like yyyy-mm</h2>

<input class="date-own form-control" style="width: 300px;" type="text">

<script type="text/javascript">


minViewMode: 1,

format: 'yyyy-mm'






I hope it can help you...