Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Allow Start of Week to be Designated #18

Open
Snugug opened this issue Oct 2, 2017 · 2 comments
Open

Allow Start of Week to be Designated #18

Snugug opened this issue Oct 2, 2017 · 2 comments

Comments

@Snugug
Copy link
Contributor

Snugug commented Oct 2, 2017

No description provided.

@KnutSv
Copy link

KnutSv commented Oct 18, 2017

I needed to set the start of the week to monday (since this is the standard here), and thought I'd post the changes I made to get this working in case they're usefull to anyone else:

calendar.js:96

const end = day === 0 ? 0 : days.length - day;

calendar.js:120+

const startDay = new Date(Date.parse(current.parsed)).getDay();
const endDay = new Date(Date.parse(`${months[current.month]} ${current.days}, ${current.year}`)).getDay();
current.start = startDay == 0 ? 6 : startDay - 1;
current.end = endDay == 0 ? 6 : endDay - 1;

Haven't been able to test it extensively, but it seems to be working fine.

@Snugug
Copy link
Contributor Author

Snugug commented Oct 18, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants