I don’t see the unique id for the hour_registration database, only see current cell or index.
The idea here is to store the daycare hours per date and child.
Input is working, but now i want to retrieve the data to show the al ready filled in hours.
That depends on what setup you using to get the calendar days in the first place.
I have things setup in my template on the ‘Google Calendar Clone’ portion that shows the full page calendar to omit any entries or rows that are not part of that month…so if month only has enough days to fill 5 rows, it shows 5 and if 6 are needed it shows 6 rows.
I only use free plugins or karmaware plugins in my templates, so in this case I am using the CalendarTools plugin to get the dates.
Here is the conditional I use to hide or show the 6th row
On other custom calendars in the template I use different conditionals
Different situations require different setups and the starting point is to know how you are getting the dates…then the conditional requires to know how to ‘hide’ or ‘show’ the dates.
I was hitting this issue before as well and you can use conditionals to try and do this.
To come up with a good solution though I added a Calendar Dates element in this plugin which retrieve the Dates up until the end of the month so that you can use a ‘Full List’ repeating group instead of a set number grid and having an extra row sometimes.
Right, that calendar doesn’t leverage the same Luxon.js library to recognize when the end of a calendar month is.
That said there is a way you can do it, it’s not the prettiest and could have a slight delay compared to the current calendar speed, but filtering the dates the toolbox returns like this could work:
thanks, everyone for your responses, I’ve recently come across a guide on creating custom calendars using a variety of APIs and implementing it in any app, you might want to check it out.
function getDaysInMonth(month, year) {
var date = new Date(year, month, 1);
var days = [];
var lastDay = new Date(year, month, 0).getDate();
for (i = date.getDay() - 1; i >= 0; i--) {
days.push(new Date(year, month - 1, lastDay - i));
}
while (date.getMonth() === month) {
days.push(new Date(date));
date.setDate(date.getDate() + 1);
}
var date3 = new Date(year, month + 1, 1);
for (i = days[days.length - 1].getDay(); i != 6; i++) {
days.push(new Date(date3));
date3.setDate(date3.getDate() + 1);
}
for (i = days.length; i != 42; i++) {
days.push(new Date(date3));
date3.setDate(date3.getDate() + 1);
}
return days;} getDaysInMonth( DYNAMIC DATAS,DYNAMIC DATAS);
I can’t get this to work with the code provided in this post, or the code from your example project. Nothing shows up in the cells with the text that’s supposed to be showing the current day’s date.
I’d like to do something like this but for a daily view showing 30 minute intervals…so lost.
I’m loving this plugin so far!
Question:
How would I create an event that would go on every Tuesday for a certain date range?
For example:
Every Tuesday for the next six months I have football practice (say September to February).
Im thinking I need to store a date range (2 Input box’s or 2 date picker’s and store these dates in the database (From / To)) Im just not sure how to parse out each Tuesday from that date range?
Anyone have any ideas?
One thought I had after many…
I can get the start date (the first date of practice), then add 6 days to that date, which will give me the next week, possibly perform some kind of an array to run through whatever six months worth is? How to perform this, maybe a custom state (so that its not going to the database) to get the results of each week. Maybe then store the weeks received to the database but have absolutely no idea how to get these back into the calendar?
@codurly thank you for sharing the knowledge. I was stuck, so had to open up the editor and made sure I picked all the bits and pieces from there. Thank you.
How can I add this calendar to a repeating group of events- Each event has its own calendar (thus calendar)?
Hello,
Thank you for the feed !
I’d like to get all the dates between a date range in order to send the list to a repeating group.
I’d like to have a planning with all the days of my date range previously picked up.
Does someone as an idea how to do so ?
Many thanks
Thank you so much for this tutorial. I tried the other codes listed here for starting on Monday and they didn’t seem to work. Here’s one I found that did, in case this is also happening to you.
function getDaysInMonth(e,t){ var a=new Date(t,e,1),D=[],n=new Date(t,e,0).getDate(),b=a.getDay(); if(b ==0)b=7; for(i=b-2;0<=i;i–)D.push(new Date(t,e-1,n-i)); for(;a.getMonth()===e;)D.push(new Date(a)),a.setDate(a.getDate()+1); var g=new Date(t,e+1,1); for(i=D[D.length-1].getDay();6!=i;i++)D.push(new Date(g)),g.setDate(g.getDate()+1); for(i=D.length;42!=i;i++)D.push(new Date(g)),g.setDate(g.getDate()+1); return D; }
getDaysInMonth(
It would be awesome to have a “start on Monday” example on the demo page for us Europeans