How do I display week starts from Sunday in datepicker along with week numbers.
eg: I need Week starting from 12/03/23(Sunday) should display week number 11 instead of 10. Any help appreciated. thanks
my code:-
$(document).ready(function() {
$('.date-picker').datepicker({
showWeek: true,
firstDay: 0,
changeMonth: true,
changeYear: true,
showButtonPanel: false,
dateFormat: 'dd/mm/yy',
autoclose: true,
});
});
<input name="sel-date" id="sel-date" class="date-picker" value="<?= $week_start ?>">
2
Answers
You can use
calculateWeek
function to change the week number:You can use the
calculateWeek
property from the datepicker also you can usebeforeShowDay
to disable the dates like i have done in the snippet..let me know
Date Picker on input field: