SearchBuilder: Date picker starts from Sunday rather than Monday

SearchBuilder: Date picker starts from Sunday rather than Monday

sarooptrivedisarooptrivedi Posts: 65Questions: 20Answers: 2

I am looking for setting to set the weekday start with Sunday rather than Monday on DateTime Picker in datatables.net.
I tried firstDay setup but nothing works

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 65,588Questions: 1Answers: 10,904 Site admin

    I think there might be a time zone error. What TZ are you in please?

    Allan

  • sarooptrivedisarooptrivedi Posts: 65Questions: 20Answers: 2
    edited February 18

    I am on MST (Mountain standard time). Is that any setting where the week start day is Sunday? I do not use the Editor.

  • sarooptrivedisarooptrivedi Posts: 65Questions: 20Answers: 2

    @allan : I found the solution but for that I need to change the datatables.js file. I am still looking for the setting which I can do in my custom code and not touch the downloaded datatables.js file.

    I changed the below code in the DateTime.defaults function

  • allanallan Posts: 65,588Questions: 1Answers: 10,904 Site admin
    Answer ✓

    Yes, set the default:

    DataTable.DateTime.defaults.firstDay = 0;
    

    I committed a change to DateTime a couple of weeks ago that will make the detection of the first day value automatic based on the browser locale. That will ship along side DataTables 3 and the other updates in the next month(ish).

    Allan

Sign In or Register to comment.