# WHY SUNDAY? please support me community!

**URL:** <https://forums.knack.com/t/why-sunday-please-support-me-community/9853>\
**Category:** Ask Developers\
**Created:** [July 5, 2021, 3:35pm UTC](https://forums.knack.com/t/why-sunday-please-support-me-community/9853 "2021-07-05T15:35:57Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarcG85145](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@MarcG85145](https://forums.knack.com/u/MarcG85145)\
**Post date:** [July 5, 2021, 3:35pm UTC](https://forums.knack.com/t/why-sunday-please-support-me-community/9853/1 "2021-07-05T15:35:57Z")

</div>

When you select a date, in all calendar popups the week starts with Sunday, and you would have to allow the week to start on Monday. I don't know if this system is common in the USA, but in Europe the weeks start on Monday. :)!  
Please support me because when we quickly mark a date we sometimes make mistakes for this reason. I've seen that since 2015 other people have asked for it but it still hasn't changed.

---

<div class="post-metadata">

**Author:** ![hmnd](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/hmnd/32/190_2.png) [@hmnd](https://forums.knack.com/u/hmnd)\
**Post date:** [August 7, 2021, 9:09am UTC](https://forums.knack.com/t/why-sunday-please-support-me-community/9853/2 "2021-08-07T09:09:50Z")

</div>

Hey Marc,

Here’s a solution I came up with. It intercepts Knack’s calls to jQuery datepicker and adds the `firstDay` option that controls which day of the week is displayed first.

Simply add the following code to your app’s JS:

```javascript
(() => {
  const jqDatepicker = Knack.$.fn.datepicker;
  Knack.$.fn.datepicker = function(options) {
    return jqDatepicker.call(this, {
      ...options,
      firstDay: 1,
    });
  };
})();

```

---

<div class="post-metadata">

**Author:** ![hmnd](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/hmnd/32/190_2.png) [@hmnd](https://forums.knack.com/u/hmnd)\
**Post date:** [August 9, 2021, 9:05am UTC](https://forums.knack.com/t/why-sunday-please-support-me-community/9853/3 "2021-08-09T09:05:37Z")

</div>

Actually, a more elegant solution would actually be to just add the following to the top of your JS:

```javascript
$.datepicker.setDefaults({ firstDay: 1 });

```

---

<div class="post-metadata">

**Author:** ![MichaelG](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/michaelg/32/758_2.png) [@MichaelG](https://forums.knack.com/u/MichaelG)\
**Post date:** [August 9, 2021, 12:00pm UTC](https://forums.knack.com/t/why-sunday-please-support-me-community/9853/4 "2021-08-09T12:00:17Z")

</div>

Fantastic David!! (if I am not mistaken on your identity)

---

<div class="post-metadata">

**Author:** ![MarcG85145](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@MarcG85145](https://forums.knack.com/u/MarcG85145)\
**Post date:** [August 9, 2021, 8:38pm UTC](https://forums.knack.com/t/why-sunday-please-support-me-community/9853/5 "2021-08-09T20:38:51Z")

</div>

Thank you very much HMND, I have tested and it works perfectly. Your code is elegant and does what it wants. I’ve been lucky to have your help.

---

<div class="post-metadata">

**Author:** ![MarcG85145](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@MarcG85145](https://forums.knack.com/u/MarcG85145)\
**Post date:** [August 9, 2021, 8:45pm UTC](https://forums.knack.com/t/why-sunday-please-support-me-community/9853/6 "2021-08-09T20:45:52Z")

</div>

By the way, can you think of a way to change the language of the calendar? I would like it in Spanish, because the months and days (acronyms) appear in English. Thanks a lot.

---

<div class="post-metadata">

**Author:** ![hmnd](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/hmnd/32/190_2.png) [@hmnd](https://forums.knack.com/u/hmnd)\
**Post date:** [August 10, 2021, 11:38am UTC](https://forums.knack.com/t/why-sunday-please-support-me-community/9853/7 "2021-08-10T11:38:18Z")

</div>

To set all relevant datepicker settings to those of the Spanish locale, you can use this:

```javascript
// Set first day of week in datepicker to Monday
(() => {
  $.datepicker.regional['es'] = {
    closeText: 'Cerrar',
    prevText: '&#x3C;Ant',
    nextText: 'Sig&#x3E;',
    currentText: 'Hoy',
    monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio',
    'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
    monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun',
    'Jul','Ago','Sep','Oct','Nov','Dic'],
    dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado'],
    dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'],
    dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'],
    weekHeader: 'Sm',
    dateFormat: 'dd/mm/yy',
    firstDay: 1,
    isRTL: false,
    showMonthAfterYear: false,
    yearSuffix: ''};
  $.datepicker.setDefaults($.datepicker.regional['es']);
})();

```

Others can use this for their own locales, too. Simply find your locale in the [GitHub repo](https://github.com/jquery/jquery-ui/tree/1-9-stable/ui/i18n) and replace the contents of `$.datepicker.regional` and `$.datepicker.setDefaults` with those from your locale’s file.

---

<div class="post-metadata">

**Author:** ![MichaelG](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/michaelg/32/758_2.png) [@MichaelG](https://forums.knack.com/u/MichaelG)\
**Post date:** [August 10, 2021, 3:38pm UTC](https://forums.knack.com/t/why-sunday-please-support-me-community/9853/8 "2021-08-10T15:38:19Z")

</div>

works PERFECT David!! I have my App in 3 languages: spanish, french and english.

great!

---

<div class="post-metadata">

**Author:** ![MarcG85145](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@MarcG85145](https://forums.knack.com/u/MarcG85145)\
**Post date:** [August 10, 2021, 11:31pm UTC](https://forums.knack.com/t/why-sunday-please-support-me-community/9853/9 "2021-08-10T23:31:30Z")

</div>

Thank you very much David!! it works perfectly. 👏 👏

---

<div class="post-metadata">

**Author:** ![Pablo1](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@Pablo1](https://forums.knack.com/u/Pablo1)\
**Post date:** [April 9, 2022, 3:01am UTC](https://forums.knack.com/t/why-sunday-please-support-me-community/9853/10 "2022-04-09T03:01:12Z")

</div>

Hi, It is not working for me. I just put this code into javascript page. Any idea?  
Thanks, Pablo.

---

<div class="post-metadata">

**Author:** ![hmnd](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/hmnd/32/190_2.png) [@hmnd](https://forums.knack.com/u/hmnd)\
**Post date:** [April 9, 2022, 8:25am UTC](https://forums.knack.com/t/why-sunday-please-support-me-community/9853/11 "2022-04-09T08:25:33Z")

</div>

Hi @Pablo1, it’s still working on my end. Are you using the exact code from the example? Is it having any effect on the date picker, or none at all?

---

<div class="post-metadata">

**Author:** ![Pablo1](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@Pablo1](https://forums.knack.com/u/Pablo1)\
**Post date:** [April 9, 2022, 12:39pm UTC](https://forums.knack.com/t/why-sunday-please-support-me-community/9853/12 "2022-04-09T12:39:05Z")

</div>

hi, none at all. I have used your js .  
Nothing happens … see this example. [Knack](https://garlan.knack.com/test#new-page/)

---

<div class="post-metadata">

**Author:** ![hmnd](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/hmnd/32/190_2.png) [@hmnd](https://forums.knack.com/u/hmnd)\
**Post date:** [April 9, 2022, 2:25pm UTC](https://forums.knack.com/t/why-sunday-please-support-me-community/9853/13 "2022-04-09T14:25:12Z")

</div>

@Pablo1 Here’s what I’m seeing:

 ![Screenshot_20220409-072221~2](https://us1.discourse-cdn.com/flex020/uploads/knack/original/2X/1/193429545c2d2222865d8c5ba2ac27f6edb7899d.png)

Are you trying to do something else?

---

<div class="post-metadata">

**Author:** ![Pablo1](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@Pablo1](https://forums.knack.com/u/Pablo1)\
**Post date:** [April 9, 2022, 3:41pm UTC](https://forums.knack.com/t/why-sunday-please-support-me-community/9853/14 "2022-04-09T15:41:26Z")

</div>

upps, sorry, now run perfect.

Btw, related to datepicker, do you know any good alternative/solution to admin from/to dates.  
I mean, select the date range just from one calendar, (different to the date std with the flag" Yes, add options like repeat and end-time to use with a calendar. ".)

thanks again. Pablo.
