2

HTML5 generates a data picker using:

<input type="date">

On my browser at least, the week starts on Monday. Is there a way of starting the week on Sunday (or any other particular day)?

Manngo
  • 10,878
  • 7
  • 66
  • 88
  • please check once first day of week in your OS date and time settings. – Nayan May 22 '22 at 06:56
  • your check there answer it already available. https://stackoverflow.com/questions/4156434/javascript-get-the-first-day-of-the-week-from-current-date – HASEEB ALAM RAFIQ May 22 '22 at 07:56
  • @HASEEBALAMRAFIQ No, that question is about using JavaScript to calculate the first day of a given week. This question is about using the browser date picker and setting the first day to Sunday. – Manngo May 22 '22 at 09:08

2 Answers2

0

It's quite a lazy solution, I know, but Jquery does the job quite well.

$("document").ready(function () {
    $( "#datepicker" ).datepicker({defaultDate: null, firstDay: 1});
})
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>

<input type="text" id="datepicker">

If you want higher security then you can download version 1.13 of jQuery UI on your PC, as 1.12 has some vulnerabities and Google doesn't host the newest version yet.

DGX37
  • 137
  • 2
  • 11
  • 1
    Sorry, trying to avoid jQuery, since that’s too much overhead for a simple job. Also all that Google stuff is way too intrusive. – Manngo May 22 '22 at 06:38
0

I think you cant but maybe you can use Javascript for change the First day but i dont know you can try use Javascript but i think you cant change it maybe you can change only on Local maybe.