Setting selectable timeslot in full calendar - fullcalendar

I've an app where I want to set what time can be selected. I want to disable rest of them.
Basically it's an appointment app where Doctors set their available time and patients reserve time.
I don't want the time slot not set as available to be selected.
I also don't want more than one user to select same time slot.
I'm of course checking this before saving it into the database but I want to prevent this on Calendar as well.
Is there any way to do that?

Related

Google calendar api v3: update all future events in recurring series limited by count

My question: how do I update "this and all future" instances in a recurring event which is limited by count so that the total number of events stays consistent?
What is the problem:
Trying to modify recurring event and I follow the below guide:
https://developers.google.com/calendar/recurringevents
Basically to update all future recurring events using a target event, the doc says one need to do two calls:
update existing event to make so it ends before the target event date
create a new recurring event with the same fields except of those need changes.
That works fine until there is an event that is limited by the number of occurrences.
Let's say there is a recurring event limited by 10 occurrences and target event is 5th event.
Now I need to split the original so that the first 4 events goes to the original one (so I update COUNT from 10 to 4) and then I create a new recurring event that holds the rest 6 events (so COUNT is 6 in this case)
My first observation is that this is not how the split events are displayed in google calendar - if I test that manually, the both events still show 10 occurrences but the second one doesn't produce any extra events (I'd expect 14 events from developer perspective, yet there are 10 as any user would expect). That implies there is a different approach here? Is it?
Also if I end up counting manually the number of events, there are still issues with cases like deleting one of the events first (let's say, the 4th event) - now how do I know that I need to show 6 instances in the new one and not 7?
Those thoughts make me think there is a better approach, but I can't find any other alternatives. Any advice on that?
UPDATE
It seems like google does it differently: for example after changing a title for "this and future" events in calendar view, it doesn't seem to produce two different recurring events since if you try to delete "all" events, that will remove all of them completely (rather than deleting only one chunk, either before or after the target event)
It seems like they are creating a bunch of exceptions or maybe "recurring exception" or something to do that. Can't find any examples on how to do that as of now thought.
Can't find any good solution for this after a few days of research and while I need to move forward I ended up with a sort of "compromise" between "good enough UX for my case" and "breaking best practice".
So I ended up updating each event individually which goes against google's warning as shown below but I limited the max count by 50. This is not necessary what others want to do, but this is good enough for the real world use case in my app.
Warning: Do not modify instances individually when you want to modify
the entire recurring event, or "this and following" instances. This
creates lots of exceptions that clutter the calendar, slowing down
access and sending a high number of change notifications to users.
And if user needs to schedule more than that, the user is asked to use "end date" instead.
Again, not ideal by any means so if anyone knows how to handle that correctly or knows how google handles that, you are very welcome to share it! (meh... and I need that for outlook too now...)
UPDATE: just got an idea: as an improvement, one can edit either "all future events" or alternatively the master event + "all previous events" depending on the index of the target event. In this case one can limit the number of requests by 2 (so in case of 50 events I'll need to do 25 requests maximum)
So if user wants to change the title from "Hello" to "Goodby" and if the user picked event number 5 in the series of 50 events to change all future events, we can change the master event to "Goodby" which will change the title of all events, and then update the first 4 events to the original "Hello".
Obligatory summary of comments and chat:
Updating events:
To update specific events in a recurring event you need to update the individual instance by specifying the event instance ID.
This is just the event ID concatenated with a datetime stamp (you can see this when making an Events: instances request for your eventID; if your event ID is xxxxxxxxxxxx then an instance ID would be something like xxxxxxxxxxxx__20200603T170000Z).
Unfortunately there's no direct update-instances endpoint so to update multiple instances in one request you'd need to use batching
The API doesn't have a dedicated method for updating recurring events regardless of the recurrence type, and I presume this is the reason the documentation says to edit the previous recurring event by cutting it down and inserting a new one, as per Google's warning:
Do not modify instances individually when you want to modify the entire recurring event, or "this and following" instances. This creates lots of exceptions that clutter the calendar, slowing down access and sending a high number of change notifications to users.
Batching:
Making a batch update on event instances does keep count consistency. If you edit instances in a batch and then use the 'this and all future events' option when deleting one of the instances of the recurring event they do all get deleted as they're still a part of the recurrance. There is no new event being created in either scenario, the event instances are being changed.
If you play around with Events: instances and use Events: update to change only some instances of an event, then you can see that they all stay part of the same recurrence chain and there is no count change.
For arbitrary large counts, even if you have a recurring event with 9999999 instances, each event still has an ID which you can retrieve from Events: instances. It's stored as a single event for event use, but the IDs of the instances are the identifiers which are different.
Honestly, it's not great that you have to edit each one manually; for large counts like 9999999 it's basically infeasible because you'll have to make a batch request for each set of 100 instances you want to change, but it's the only option available via the API at the moment.
Feature Request:
You can however let Google know that this is a feature that is important for the Calendar API and that you would like to request they implement it. Google's Issue Tracker is a place for developers to report issues and make feature requests for their development services, I'd urge you to make a feature request there, the Calendar API feature request form can be found here.

Add Multiple Time Values to A UserForm

I need assistance with displaying multiple time values on a userform. They will be listed in a list box and will need to remain static should a record require editing.. The user will not have access to the excel worksheet. I need to didplay: time in: time seen; time out on the userform and on a hidden worksheet. I can use the NOW function to record the current time when the customer fills out the form and submits their record(time in). How would I go about writing code that will record the time when the clerk retrieves the customer for service(time seen) and when the customer leaves the office(time out)?
Our clerks have to bring walkin customers in for service within 30 mins of arrival. They also have to issue badges to customers with appointments within 30mins of arrival. Hope that explanation helps. Thanks.
If you are talking about frontend technology then i will suggest Angular with Reactive forms where you can generate the form fields without writing multiple times by using form builder feature. follow below link to know more.
Angular Reactive form guide

Tracking events and making sense of it

Lets say I wish to track
User action - game he played - which area he stays - his house number.
If I were to track these event actions in Tabular format, it would look like:
UserId|Game|Area|House|Timestamp so on.
Then I can always run SQL queries if I want to answer few business queries. Like
1. In a given day/week, who is the most active User
2. Which game is most-played?
3. Which area plays most events
4. Which user from which area are the most active
Whats the best way to capture this using Google analytics? Will custom dimensions be useful. Or GA is not suitable for this kind of insight?
Thanks.
First of all, the house number is too precise, it would be against GA's ToS.
In GA everything is captured in "hits", you can think of this as one "row" of data.
Let's look at what you wanted to find out:
Most Active User? - This depends on how you determine "Active". Is it the longest Session durations? Tried most games? Most logins? Most sessions? To track a user, you'd need a User ID tracked.
Which game is played the most? - Again, what is played the most? Longest time in game? Most "start" games? This would require you to know the Game that was played and when someone started playing
Which area is most active? -This would go back to the definition of active, the region information is needed along with the active definition
Which users are most active in an area? Same as above, the user would need to be identified and area
To determine which Custom Dimensions (CDs) you want, let's look at the example data points you want to track and try to determine the scope and if it already exists as a standard dimension:
User ID - this is obviously related to the user, makes sense to be user-scoped
Game - This is a tougher CD. I would think that in a single session, users can play multiple games, thus I'd think you'd want this to be hit-scoped.
Area - GA already provides this based on the ISP
Timestamp - GA already provides time dimensions
From above, we can determine that you need to create two CDs, one to track User ID, the other to track the Game.
You can also look into using the userid feature in GA for cross-device tracking.

FullCalendar - Event with different 2 dates and time. Fist to Pick-UP and second Delivery Date/time

I'm trying to create an event with 2 different date/time.
I am using a system at appointment services at home. I use fullcalendar for schedule jobs.
I want to create an event with two dates, one is the date when I will make Pick Up and the second when I will Delivery the order.
The easiest solution for this would probably be to simply create two events and reference them to each other, You can for example create a field in your database or whatever you are using to store events, and add a "category" field, where a event can either be of category "pick-up" or "delivery". In your JS you can then use that field to determine what to do with the given event.
Additionally, you will need a field where you refer both events to each other.
LMK if you need further assistance, although I would like some more concise information, so I can fully comprehend what you are trying to do

Google Analytics - Track Funnel With Loop

I've got a process on my website that I would like to track as a funnel, except I am unclear on how to do so since the process has a loop.
We are building a single-page tool that calculates the number of products the user needs for their home, which is based on how many rooms the home has and the details of each room. Here is an example workflow:
Create Home
Add Room 1, set details, click Save
Add Room 2, set details, click Save
Edit Room 1 details, click Save
Click Analyze
As you can see from steps 1 and 2, the user can add a variable number of rooms. From step 4 you can see that they can go back to edit a room after they've created it.
I would like to see where users drop off, so I'd like to see this funnel, minimally:
Create Home -> Save at least 1 room -> Click Analyze
If I track "Save Room" as a page view (/save-room) there will be a lot of drop off once users start to add more rooms: it will look like they exit the funnel at /save-room by going to /save-room... right? Should I control this with Javascript to make sure that the /save-room pageview is only sent once per process? Is there a better way?
Additionally, I would like to track whether people with larger homes (more rooms) drop off more frequently. So if I prevent additional /save-room page views from being sent, I would lose this visibility. Should I track all of these operations as events as well?
Thanks in advance!
Funnels do (literally) not have loops (that's one of the reasons Google introduced flow reports).
One possible way would be to create a session based custom metric. You set it to 1 at the first "save room" pageload, then instead of doing more "save room" pageviews you track an event for each additional room and increment the custom metric in the event (thus saving the number of rooms; you'd need to create a custom report, since custom metrics do not show up in standard reports, but you would get the info for the number of rooms and still be able to use the funnel visualization).

Resources