How to re-fetch events when you navigate months? - fullcalendar

I am working on fullcalendar + Nylas (Calendar Sync service).
Nylas is fetching only 1000 event per request from server. so I need re fetch new events on navigate every month full calendar. I need js code only for fullcalendar refetching event while navigate the months.

The Nylas Events endpoint has the option to filter GET requests by starts_after. You can make a request that searches from the start of the month and filter out any events that happen in the following month.

Related

FullCalendar.io - Get All Events

I'm using the standard FullCalendar Events(as a json feed) and have everything working fine...almost.
var calendar = new Calendar(calendarEl, {
events: '/myfeed.php'
});
My initial view is a 'dayGridMonth' so the FC default behavior is to only retrieve the events for that month by appending the startParm/endParam querystring.
This is not what I want.
On the backend of this request, I'm currently sending the entire calendar feed (ignoring the start/end params) so I don't have to keep hitting my AJAX '/myfeed.php' page every time somebody clicks on "Next" to view the next month.
However, I can't get FullCalendar to know that it already has the whole json feed and not to bother getting anything else - just show the next month from the data we have. I've played around with lazyFetching but that seems to force that it goes to the AJAX call every time.
Any ideas on how I do this?
Thx!

Full day event not correctly showed on free busy request

i am having an issue when call free busy request on Google Calendar API.
Full day event are not showed correctly.
If I have an event on 23/04/2018 (full day event)
the FreeBusy request return this:
{"calendars":{"null":{"busy":[],"errors":[{"domain":"global","reason":"notFound"}]},"<MYEMAILADDRESS>":{"busy":[{"end":"2018-04-23T08:15:00.000Z","start":"2018-04-23T08:00:00.000Z"}]}},"kind":"calendar#freeBusy","timeMax":"2018-04-24T06:00:00.000Z","timeMin":"2018-04-23T05:00:00.000Z"}
As you can see the start/end time is not useful.
Otherwise if i get the event from event list API, the event has not a time but only date (correct).
Any suggestion?
Thanks

Trigger analytics event in the past with a specified date

I'm capturing the date of a product installation when user extends a trial, and pass it to a thank you page as a parameter. Then I capture it and want to retroactively trigger event in the past.
From docs the code looks like:
ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]);
And nothing is said about ability to set any dates.
Is there a way to do it?
You can not push any events retroactively in Google Analytics.
All data is connected to the time that they were sent on.

Send google analytics event in loop

I'm a newbie in analytics.
I want to track a record-created event every time someone creates a time-record in a web application for time-tracking. But the user can also copy a time record to multiple dates which should yield one record-created event for each new record.
Would a simple loop work or does google think my events are coming to them too fast? Should I add a setTimeout?
_.each(dates, function() {
ga('send', 'event', 'record-created');
// maybe wrap the line above in a setTimeout ?
});
As per documentation:
Each analytics.js tracker object starts with 20 hits that are
replenished at a rate of 2 hit per second. Applies to All hits except
for ecommerce (item or transaction).
Plus you have "only" 500 interaction hits per session, so you should not send too many events or GA will drop data.

Refresh ASP.NET page periodically to display real time data from SQL Server

I have a shopping cart based application in asp.net 2.0 which uses the concept of group buying.My requirement is that when user checks out a particular product,he should do it with the latest price of that item at that time.
Now there is a scenario.
I have a product with price 50.I did a checkout.50 is displayed in my cart.At the same time some other user is accessing the product and now based on some business logic,we calculate the price.the second user did some activity which reduced the price to 45. I have a trigger which updates all shopping cart items with this new price.
I want to show this updated price on the frontend of the first user without a postback. or i want to give him a message that this price has changed so do a page refresh.
I have the following options.
1) The repeater control which shows the cart should be put under an update panel and that update panel should be refreshed after some interval using a timer.
2) use SQL Server notification services and invalidate the cache as soon as the data changes in database.
I do not want to use notification services as I am not caching the data.Secondly problem with update panel and timer control in that it will be a overhead to refresh it and refresh time is hard to find.
Please tell me a way to accomplish this scenario.
I would generate JavaScript that updates all Repeater items (html fields with prices), and has setTimeout() for periodical checking to web service (wcf, asmx or ashx) if price has changed. If it has, then i would retrieve all prices and update HTML fields! User don't need to prees anything, you can show him some notice that price has changed.
With jQuery and JSON for object serialisation this could be easily accomplished.
This is usually done via ajax from the client (browser) side of things. Perhaps this approach will work for your requirements as well?
Using ExtJs core, you can make an ajax call as follows:
Ext.Ajax.request({
url: 'ajax_demo/sample.aspx',
params : {'requestType':'check-sql-prices'}
success: function(response, opts) {
var obj = Ext.decode(response.responseText);
// process the response JSON object.
},
failure: function(response, opts) {
// this writes the the firebug console.
console.log('server-side failure with status code ' + response.status);
}
});
Ext Core also handles "Timed Code Execution", so you could run the check, say, every 30 seconds. Round trip timing is usually less than 100 milliseconds, but that would definitely depend on your "SQL price checking" logic.

Resources