Fullcalendar timezone not correct in window.open (google calendar - timezone

Since a while, I'm using the google calendar from fullcalendar.io
lately I noticed that my events are 'published' in my timezone (Europe/brussels) when I click on the event and when I'm not logged in to my google's account.
They are listed correct in the calenders month view as well as in the google calendar.
Side note: When I log in to my google account, the time of my event is correct in my event.
Here is a piece of my code:
$(document).ready(function() {
$('#calendar').fullCalendar({
firstDay:1,
weekNumbers:true,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultView: 'month',
eventClick: function(event) {
// opens events in a popup window
window.open(event.url, 'gcalevent', 'width=700,height=600');
return false;
},
Any help or suggestions?
Thanks in advance

Related

Rails: How to add a video call when creating a new Event through Google Calendar API

I am using the typheous gem to create a new Event through the Google Calendar API (V3). The response returns 200 and a Calendar Event is created. My question, is there a way to always create the Event with a video-call attached as well?
response = Typhoeus::Request.new(
"https://www.googleapis.com/calendar/v3/calendars/calendarId/events",
method: :post,
body: {
start: {
dateTime: Time.parse(split_time_range[0])
},
end: {
dateTime: Time.parse(split_time_range[1])
},
attendees: [
{
email: "#{ENV["my_email"]}"
}
],
summary: "New Meeting"
}.to_json,
params: {access_token: session[:google_calendar_access_token], calendarId: "primary", sendNotifications: true},
headers: {"Content-Type": "application/json"}
).run
The Google Calendar event body does have a field called HangoutsLink
hangoutLink string An absolute link to the Google+ hangout associated with this event. Read-only.
As you can see this field is read only. I would try and send it when you are creating your event but i am not sure its something you can set with the API.
There is an issue logged for this Calendar API: Hangout not being added automatically to event when creating using the API. I have not been able to find the "automatically create a video call to a created event" setting which they speak of but its an old issue this may have been removed.

Fullcalendar rendering the wrong time and date

I have a NodeJS application that uses Fullcalendar on the client side.
This very same app, when run on my dev environment renders the calendar with the correct dates and times.
When I run it on the production box, the dates and times are being rendered wrong. It's just like it's ignoring the timezone information. What's weird is that the client is still me and that the production server is sending as output the same JSON that you can see there:
[{"id":"53a2d4f2eec975b1095ef5c7","title":"prova","start":"2014-06-18T22:00:00.000Z","end":"2014-06-19T18:00:27.000Z","allDay":false},{"id":"53a2d4f2eec975b1095ef5c7","title":"prova","start":"2014-06-19T22:00:00.000Z","end":"2014-06-20T18:00:27.000Z","allDay":false},{"id":"53a2d4f2eec975b1095ef5c7","title":"prova","start":"2014-06-20T22:00:00.000Z","end":"2014-06-21T18:00:27.000Z","allDay":false},{"id":"53a2d4f2eec975b1095ef5c7","title":"prova","start":"2014-06-21T22:00:00.000Z","end":"2014-06-22T18:00:27.000Z","allDay":false},{"id":"53a2d4f2eec975b1095ef5c7","title":"prova","start":"2014-06-22T22:00:00.000Z","end":"2014-06-23T18:00:27.000Z","allDay":false},{"id":"53a2d4f2eec975b1095ef5c7","title":"prova","start":"2014-06-23T22:00:00.000Z","end":"2014-06-24T18:00:27.000Z","allDay":false},{"id":"53a2d4f2eec975b1095ef5c7","title":"prova","start":"2014-06-24T22:00:00.000Z","end":"2014-06-25T18:00:27.000Z","allDay":false},{"id":"53a2d4f2eec975b1095ef5c7","title":"prova","start":"2014-06-25T22:00:00.000Z","end":"2014-06-26T18:00:27.000Z","allDay":false},{"id":"53a2d4f2eec975b1095ef5c7","title":"prova","start":"2014-06-26T22:00:00.000Z","end":"2014-06-27T18:00:27.000Z","allDay":false},{"id":"53a2d4f2eec975b1095ef5c7","title":"prova","start":"2014-06-27T22:00:00.000Z","end":"2014-06-28T18:00:27.000Z","allDay":false},{"id":"53a2d4f2eec975b1095ef5c7","title":"prova","start":"2014-06-28T22:00:00.000Z","end":"2014-06-29T18:00:27.000Z","allDay":false},{"id":"53a2d4f2eec975b1095ef5c7","title":"prova","start":"2014-06-29T22:00:00.000Z","end":"2014-06-30T18:00:27.000Z","allDay":false},{"id":"53a2fe7beec975b1095ef5c9","title":"aaa","start":"2014-06-18T06:00:00.000Z","end":"2014-06-18T11:00:00.000Z","allDay":false}]
The calendar is being initialized this way:
$(document).ready(function() {
$('#calendar').fullCalendar({
events: '/scheduler/events',
firstDay: 1,
timeFormat: 'HH:mm',
header: {
left: 'title',
center: '',
right: 'today, prev, next, month, agendaWeek'
},
timezone: "local",
dayClick: function(date, jsEvent, view) {
},
eventClick: function(event, jsEvent, view) {
});
}
});
As an example, I'm in the CEST timezone and the very first record of the JSON should display as start 2014-06-19 00:00:00 and end 2014-06-19 20:00:27 but it displays 2014-06-18 22:00:00 and 2014-06-19 18:00:27
I tried setting the timezone option of Fullcalendar to "local", false, "UTC", "CEST" but with no luck.
Any idea of what might be wrong?
Thanks!
Thanks to the author of Fullcalendar who pointed me in the right direction. The answer is that Node JS doesn't get the correct timezone from the OS for some unknown reason. It does get it on my development box (OSX) but on the production one (Linux) it doesn't.
I simply added this to my start script and now it works like a charm:
export TZ="Europe/Rome"

What is the simplest way to get a twitter feed and get around the request limit?

I've done a few hours of reading about writing an application that queries the twitter API and authenticates with OAuth, but they all seem too complex for my simple task at hand:
I have a handful of customer websites, all showing their twitter feed on the home page, all running on the same server. I do this by consuming the RSS feed of their tweets and output their latest tweets, formatted as HTML.
The problem is that as I gain more customers, I end up hitting the request limit near the end of the hour.
If I instead do an oauth authenicated API request for each customer, that will get me around the rate limit, but it seems overkill. I have to get every customer to give me an oauth key, just to show their tweets on their website? Can they even give me a key that lasts for ever?
All the oauth examples I've seen on the internet are for applications that do oauth requests all day, applications that will post to people's twitter feeds for them, etc. My needs are much more simple, and I'm hoping someone has a simple answer.
The easiest way is to use the pre-built Twitter Widgets.
You will not need to use OAuth - there are no rate limits.
The basic code looks like
<script charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 4,
interval: 30000,
width: 250,
height: 300,
theme: {
shell: {
background: '#333333',
color: '#ffffff'
},
tweets: {
background: '#000000',
color: '#ffffff',
links: '#4aed05'
}
},
features: {
scrollbar: false,
loop: false,
live: false,
behavior: 'all'
}
}).render().setUser('edent').start();
</script>
You can create and customise a widget which shows all of a user's tweets directly from the Twitter website.

JQuery UI dialog cannot load page content dynamically?

I have used a tutorial http://www.devcurry.com/2010/06/load-page-dynamically-inside-jquery-ui.html to dynammically load an aspx page into a jquery ui dialog without using an iframe
eg.
$(function() {
$('<div>').dialog({
autoOpen: true,
modal: true,
open: function() {
$(this).load('Example.aspx');
},
height: 400,
width: 400,
title: 'Dynamically Loaded Page'
});
When I debugged this page it just loading a blank dialog box with none of the content in even though the page has content. I have written it with the paths
eg $(this).load('/Home/Example.aspx');
I have even added in a function to check if it is loading
eg $(this).load('/Home/Example.aspx', function(){alert(Load Successful);}); which does return true YET still no content in the dialog
I am using Jquery 1.3.2 an ui 1.7.3 with ASP.Net Mvc
I know there are lots of questions/answers on this topic on stackoverflow but none of them seem to be successfully answering my problem and as these questions seem a year old not sure whether someone will get back to me asap.
Any ideas on showing the content in the dialog
Thank you
Just a thought, try changing your selector to
$('<div></div>').dialog({
Also the example you cited is using jquery 1.4.2 and jquery ui 1.8.1,
can you upgrade?
Edit:
You could also try it this way.
$(function() {
$('<div></div>').load('Example.aspx', {},
function(data) {})
.dialog(
{
autoOpen: true,
modal: true,
height: 400,
width: 400,
title: 'Dynamically Loaded Page'
}).dialog('open');
});
Note I haven't tested this, but its the way I do it. Hopefully you get the idea.
The answer is...
$(function() {
$('<div></div>').hide().load('Home/Example #content_form', function() {
$(this).dialog({
autoOpen: true,
modal: true,
height: 400,
width: 400,
title: 'Dynamically Loaded Page'
})
})
With Example.aspx having a tag with ID = content_form

How do I get the Id of a button of a jquery UI dialog?

as the title says....
this is what I have tried but not working
$('#uxReferralAssessmentDetailsDialog').dialog({
autoOpen: false,
modal: true,
width: 400,
title: "Referral Assessment",
buttons: { "Save":{ id: 'uxbtnSaveAssessment', click:othis.OnAssessmentSave}, "Cancel": function() { $(this).dialog("close"); } }
});
I am using selenium and instead of the horrid xpath I want to use the id of each element to simplify the xpath
any ideas welcome
If you are having a hard time determining id as and other things that are being added to the html page by javascript on the fly. Try using a development tool for web browsers like firebug which is an addon for firefox:
See link for firebug addon for more information:
https://addons.mozilla.org/en-US/firefox/addon/1843

Resources