Skip to content
By Mikel Lindsaar

Javascript FullCalendar time zone support with Rails

It's a little known fact, but even though I head up this awesome team of Rails Developers, I get to still get my hands dirty in the code base of applications.

We use the excellent FullCalendar JQuery plugin in some of our and our clients applications, but there was a situation where Rails seemed to be ignoring the time zone setting that FullCalendar was sending as part of it's update method.

FullCalendar would send a string "2013-01-25 11:00:00 +1100" and Rails would save it to the database as "2013-01-25 11:00:00" which basically meant it was being saved with it's time zone information stripped.

This didn't make sense as the Rails app had the following in application_controller.rb:

around_filter :set_time_zone
def set_time_zone(&block)
  Time.use_zone(current_user.time_zone, &block)

And in the config/application.rb file:

config.time_zone = 'UTC'
config.active_record.default_timezone = 'UTC'

The solution though turned out to be simple, change FullCalendar to post in an ISO string representing the time, instead of a normal Javascript string.

So, we have the following (edited) config for FullCalendar:

  eventSources: [{
      url: '/my/calendar_events',
      ignoreTimezone: false
  eventResize: function(event,dayDelta,minuteDelta,revertFunc) {

Then the update action is:

function updateEvent(the_event) {
    type: 'PUT',
    url: "/my/calendar_events/" +,
    data: { calendar_event: { name: the_event.title,
               starts_at: the_event.start.toISOString(),
               ends_at: the_event.end.toISOString(),
               all_day: the_event.allDay
    dataType: "json"

Notice the call to toISOString() in there? That formats the time as "2013-01-25T01:00:00.000Z" which means it's always sending UTC time. Rails parses this correctly and saves it into the database correctly and voila, no more time zone issues with FullCalendar.

Popular Articles by Our Team

Our expert team of designers and developers love what the do and enjoy sharing their knowledge with the world.

We Hire Only the Best

reinteractive is Australia’s largest dedicated Ruby on Rails development company. We don’t cut corners and we know what we are doing.

We are an organisation made up of amazing individuals and we take pride in our team. We are 100% remote work enabling us to choose the best talent no matter which part of the country they live in. reinteractive is dedicated to making it a great place for any developer to work.

Free Community Workshops

We created the Ruby on Rails InstallFest and Ruby on Rails Development Hub to help introduce new people to software development and to help existing developers hone their skills. These workshops provide invaluable mentorship to train developers, addressing key skills shortages in the industry. Software development is a great career choice for all ages and these events help you get started and skilled up.

  • Webinars


    Webinars are our online portal for tips, tricks and lessons learned in everything we do. Make the most of this free resource to help you become a better developer.

    Learn more about webinars

  • Installfest


    The Ruby on Rails Installfest includes a full setup of your development environment and step-by-step instructions on how to build your first app hosted on Heroku. Over 1,800 attendees to date and counting.

    Learn more about Installfest

  • Development Hub

    Development Hub

    The Ruby on Rails Development Hub is a monthly event where you will get the chance to spend time with our team and others in the community to improve and hone your Ruby on Rails skills.

    Learn more about Development Hub

Get the “reinteractive Review” Monthly Email