Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for an array of timeslots? #27

Open
Unclearogre opened this issue Jun 24, 2024 · 2 comments
Open

Add support for an array of timeslots? #27

Unclearogre opened this issue Jun 24, 2024 · 2 comments

Comments

@Unclearogre
Copy link

My son's school has different schedules on different days. Some days they only have 3-4 classes while others they have all the classes (for shorter periods). And some days are longer than others.

It would be great if it could be set up something like this:

timeslots: {
mon: [ "8:00", "10:00", "12:00", "14:00", "16:00" ],
tue: [ "8:00", "9:00", "10:00", "11:00", "12:00", "13:00", "14:00" ],
wed: [ "8:00", "10:00", "12:00", "14:00", "16:00" ],
thu: [ "8:00", "12:00", "16:00" ],
},

Maybe even add support for "def:" for a default schedule so that if every day is the same save one, you could just do:

timeslots: {
def: [ "8:00", "10:00", "12:00", "14:00", "16:00" ],
sat: [ "9:00", "13:00" ],
},

In the case where weekdays are all the same schedule but Saturday is different, for example.

@Unclearogre
Copy link
Author

Unclearogre commented Jun 24, 2024

I'm not JS expert but would changing the definition of "var timeslots" to this work?

// get timeslots
var timeslots = this.config.schedule.timeslots[dow];
if(timeslots == undefined)
{
timeslots = this.config.schedule.timeslots["def"];
}

@Unclearogre
Copy link
Author

I created a fork and made the changes. I've submitted a pull request to merge it back in. I'm not sure if I did that correctly (I'm still new to Git) but the code should be available if you just want to add it to the original.

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

No branches or pull requests

1 participant