calendarHTML-Javascript icon indicating copy to clipboard operation
calendarHTML-Javascript copied to clipboard

How to start Week from Monday?

Open ATM-NET opened this issue 5 years ago • 3 comments

ATM-NET avatar Feb 19 '20 13:02 ATM-NET

You should move https://github.com/niinpatel/calendarHTML-Javascript/blob/303d2433edc6d26ed6cebcf3680820c4cd487b0e/index.html#L20 after Saturday and replace https://github.com/niinpatel/calendarHTML-Javascript/blob/303d2433edc6d26ed6cebcf3680820c4cd487b0e/scripts.js#L33 with

let firstDay = (((new Date(year, month)).getDay() - 1) + 7) % 7;

For a live example of this you can look at https://verhuurkalender.hubovra.nl/

fantostisch avatar Feb 26 '20 15:02 fantostisch

Thanks a lot @fantostisch It saves my day.

mah3uz avatar Feb 03 '21 09:02 mah3uz

You will just want to change this part:

Screen Shot 2022-07-01 at 12 41 16 AM

Here, you just change the numbers in the loops as shown in the screenshot. Also, do not forget to change that number inside if() condition.

Then, you will want to change this in the HTML:

Screen Shot 2022-07-01 at 12 43 17 AM

So what I did was just changing the order of th tags.

I hope I helped you out! In case I did not, you can always mention me here in the discussion and I will definitely help you out!

niyazidageek avatar Jun 30 '22 20:06 niyazidageek