bokmann / fullcalendar-rails Goto Github PK
View Code? Open in Web Editor NEWan asset gem containing Adam Shaw's excellent fullcalendar jquery plugin
License: MIT License
an asset gem containing Adam Shaw's excellent fullcalendar jquery plugin
License: MIT License
Hi,
Just checking if you will have time to do the latest full version update, 2.10? It has quite a lot of changes but none that should effect your repository, more for how it is used.
I don't know how to help or I would help you do it. Thanks for your effort.
I recently opened a similar issue and got help from @davidwessman.
See my question at stackoverflow.
My application is in Rails 5.0.0.1, therefore I have to use form_tag
in place of the form_with
suggested by @davidwessman in his answer and in his gist.
Considering the scope suggested: scope(:place, (search), -> { where('place LIKE ?', "%#{search}%") })
, I had to add a comma after (search), otherwise Atom's Linter would raise an error. Also I could not use it in the event model, because I receive the following error:
undefined local variable or method `search' for #<Class:0x007f6979f9c128>
Therefore, I changed the scope with the method below:
def self.place(search)
where("place ILIKE ?", "#{search}")
end
I made two attempts, one defining @events
in the index action of the events controller, the other in a custom feed action as suggested by @davidwessman, however they both fail: fullcalendar does not show up.
I created two gists with my two attempts in case someone of you want to check my code: gist1 and gist2.
My server log is below:
Started GET "/events?utf8=%E2%9C%93&place=london&commit=Search" for 127.0.0.1 at 2017-08-13 16:28:10 +0200
Processing by EventsController#index as JS
Parameters: {"utf8"=>"โ", "place"=>"london", "commit"=>"Search"}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
Rendering events/index.html.erb within layouts/application
Rendered events/index.html.erb within layouts/application (1.0ms)
Rendered layouts/_shim.html.erb (0.3ms)
Rendered layouts/_header.html.erb (2.1ms)
Rendered layouts/_footer.html.erb (0.3ms)
Completed 200 OK in 88ms (Views: 83.8ms | ActiveRecord: 0.2ms)
NOTE: one strange thing is that when I go to the event index page the input is pre-filled with the following content: {:id=>"place-field", :placeholder=>"Search events"}
Thank you for maintaining this gem, I love when I can just include a gem rather than commit a JS file in the version control.
There has been an important bugfix which we need in our application. So it would be great to see this updated to the latest version :)
What if we want to change the default view for a calendar?
Based on the question posted here in Stackoverflow. I followed the same installation and implementation for fullcalendar but it doesnt. It shows the calendar but doesnt show the buttons (prev, next, day, week, month) etc..
I tried bundle updating just now, but I'm guessing it hasn't been changed?
Worked a bit with some testing of my modules which implements Fullcalendar and I thought it would be nice to add some testhelpers to the gem.
Would you like this? Or do you just want to put the JS in the pipeline?
Cheers, David
The current version of fullcalendar is 3.2.0 while this gem is packing the 2.8.
Hi there,
I'm using fullcalendar-rails gem and also the kaminari gem for pagination. The pagination does not happen if I just include full calendar on my application.js file.
doesn't work because of 'http' protocol .
<script src='http//fullcalendar.io/js/fullcalendar-2.1.1/lib/moment.min.js'></script> <script src='http//fullcalendar.io/js/fullcalendar-2.1.1/lib/jquery.min.js'></script> <script src="http//fullcalendar.io/js/fullcalendar-2.1.1/lib/jquery-ui.custom.min.js"></script> <script src='http//fullcalendar.io/js/fullcalendar-2.1.1/fullcalendar.min.js'></script>Hi,
I create a pull request to upgrade to FullCalendar 2.4.0
hi
Do you planed to update the gem to fullcalendar 2
Looks like there are a number of existing pull requests to upgrade this library to at least version 4.3.1. Would it be possible to merge them and publish new versions of the gem? Thanks!
http://arshaw.com is down.
plz check it.
Released on 7/18/13.
I have a ruby on rails app, that i tryed to implement the FullCalendar, but when i open the view is showing nothing.
My Gemfile :
ruby "2.4.4"
gem 'rails', '~> 5.1.4'
gem 'puma', '~> 3.7'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
# Custom Gems
gem 'country_select'
gem 'will_paginate', '~> 3.1.0'
gem 'devise', '4.4.1'
gem 'dotenv-rails', groups: [:development, :test]
gem 'fullcalendar-rails'
gem 'momentjs-rails'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
gem 'sqlite3'
end
group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :production do
gem 'pg', '0.21.0'
end
This is my application.js
//= require turbolinks
//= require_tree .
//= require moment
//= require fullcalendar
function eventCalendar() {
return $('#event_calendar').fullCalendar({events: [
{
title : 'event1',
start : '2010-01-01'
},
{
title : 'event2',
start : '2010-01-05',
end : '2010-01-07'
},
{
title : 'event3',
start : '2010-01-09T12:30:00',
allDay : false // will make the time show
}
]});
};
function clearCalendar() {
$('#event_calendar').fullCalendar('delete'); // In case delete doesn't work.
$('#event_calendar').html('');
};
$(document).on('turbolinks:load', eventCalendar);
$(document).on('turbolinks:before-cache', clearCalendar)`
My application.css
*= require_self
*= require fullcalendar
*/
My view
<div id="calendar"></div>
If it helps this is my git hub https://github.com/Oredna/Prawo
I dont know what to do, i have tryed everything, and i dont know what to do anymore.
As stated in title. Thanks!
I to do all task as guide.
I use Rails 4.
Installation
In order to install the fullcalendar-rails gem and get FullCalendar working within your application, do the following steps:
Add to gemfile
gem 'fullcalendar-rails'
gem 'momentjs-rails'
Bundle install and restart rails server.
Add to application.js
//= require moment
//= require fullcalendar
$('#calendar').fullCalendar({});
Add to application.css
*= require fullcalendar
In view, include the following html:
i have events nested within services. How do I include this as an eventSource, the url is like so /services/:service_id/events , so far I can only get it to work if I use this as the url (/services/1/events) which requires me to include the service ID manually.
I am using Google Calendar. I am new to using fullcalendar. I am a true novice using JavaScript.
I have days in my calendar where more than one event is listed. They appear correctly when I display the calendar in Google or use their embed code to display the data on a webpage. However when I try to use fullcalendar it will only show the first event for a single day.
Here is my JavaScript in application.js
$(document).ready(function() {
$('#calendar').fullCalendar({
height: 300,
events: {
url: 'https://www.google.com/calendar/feeds/[email protected]/public/basic',
className: 'gcal-event', // an option!
currentTimezone: 'America/Chicago' // an option!
}
});
});
I have defaultView: 'basicWeek' in my fullcalendar.js file.
I have gone through the thorough documentation but could not figure out what setting to change. I have done searching online on this for almost a month but have not seen any questions relating to this issue. I suppose I may just need to update a parameter in the JavaScript somewhere. I am reporting it here just in case it may be a software issue.
Any help would be appreciated.
when i integrate/share a calendar from the google apps account the events are not fetched and all the events onto the calendar disappear. where as Events are properly fetched and displayed from the normal gmail account.
Is there any way to integrate calendar from the google apps account using the xml link?
Safari 8.0.6, OSX 10.10.3...
Dowloaded your example (but it's 1.6 version)... upgraded to rails 4 and last version of gem
Google Chrome - works fine
<script src='fullcalendar/lang/es.js'></script>
I'm new to rails so maybe I'm doing something wrong but I added the gem to the gemfile, ran bundle, it installed with no errors but I don't see any additions to the manifests or new .js files in my app. I tried adding a jquery reference just to check but no luck. What am I doing wrong? I'm using Rails 3.1.1
Which Rails version does this engine support?
Currently you're linking to http://blog.crowdint.com/2014/02/18/fancy-calendars-for-your-web-application-with-fullcalendar.html as a reference. Following instructions I wasn't able to get a working sample. The link mentions the following....
$('#calendar').fullCalendar(
events: '/events.json'
);
This does not work for me. Instead, I wrapped the events parameter in an object like this...
$('#calendar').fullCalendar({
events: '/events.json'
});
The 2nd example worked. The former threw an error. Am I missing something or are things maybe not up to date?
First of all, I can't tell you how grateful I am to have this gem!
On to the issue. In the latest version I've discovered that events rendered a day prior to their actual start
.
2.8.0 is out now
You both recommend same gem name for install:
gem "fullcalendar-rails"
Hi,
I find this gem very useful, however, I was missing some information on how to properly integrate the assets with a Rails application. So I fiddled around a little bit (actually I had to look up the names of the assets here on GitHub). To integrate the assets (Javascript and CSS files), I added them to my application.css.scss and application.js file
Here's the excerpt from my application.css.scss:
*= require fullcalendar
*= require fullcalendar.print
An here's the excerpt from my application.js
//= require fullcalendar
//= require gcal
For the Javascripts, it should also be pointed out in which order the files should be included / loaded.
It would be great if you could provide further description on the above (probably also with some alternatives).
Cheers
Calendar is showing current date after refreshing the page. For example if i am in month of September after refreshing the page it is showing current month august. I want to show same month events where i refresh the page.
Hello,
i tried last version of your gem: 2.1.1 It has some layout problem with activeadmin so i'm using the 2.0.2 Anyway both fails to update the db when I drag events.
$.ajax
url: "/admin/events/" + the_event.id,
type: "PUT",
dataType: "json",
data:
event:
title: the_event.title,
starts_at: "" + the_event.start,
ends_at: "" + the_event.end,
description: the_event.description
Started PUT "/admin/events/2" for 127.0.0.1 at 2014-10-30 12:14:55 +0100
Processing by Admin::EventsController#update as JSON
Parameters: {"event"=>{"title"=>"Caricamento", "starts_at"=>"1412208000000", "ends_at"=>"1412208000000", "description"=>"Selezionare per caricamento"}, "id"=>"2"}
(3.0ms) EXEC sp_executesql N'UPDATE [events] SET [starts_at] = NULL, [ends_at] = NULL, [updated_at] = ''2014-10-30T11:14:55.964'' WHERE [events].[id] = 2; SELECT @@ROWCOUNT AS AffectedRows'
I'm trying to figure out what the difference between the normal fullcalendar and its scheduler premium add-ons as I'll need it in a new rails application I'm working on. Does this gem provide the option of scheduler or is that something I would need to manually deal with? Any help is much appreciated!
I've updated fullcalendar-rails and generated an API key then turned on Calendar API.
I've added my API key to my code and now I'm getting this error:
$(document).ready(function() {
$('#calendar').fullCalendar({
googleCalendarApiKey: '<secret>',
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaDay',
timezone: 'Europe/London',
},
timeFormat: '',
events: '<secret>@import.calendar.google.com',
timezone: 'Europe/London',
loading: function(bool) {
$('#loading').toggle(bool);
},
eventClick: function(event) {
if (event.url) {
return false;
}
},
});
});
I'm getting these errors:
Uncaught ReferenceError: moment is not defined fullcalendar.js?body=1:13
Uncaught TypeError: Cannot read property 'applyAll' of undefined gcal.js?body=1:20
Uncaught TypeError: Cannot read property 'applyAll' of undefined gcal.js?body=1:20
fullcalendar.js
http://pastebin.com/zi6egy3H
gcal.js
http://pastebin.com/KNVY0tFW
Hi there, it looks like this gem is a bit behind as far as fullcalendar goes. Would you be interested in releasing a version with the latest version of fullcalendar?
the option "locale" does not work, the solution is adding the following line to aplication.js
//= require fullcalendar/locale-all
maybe you can add it to the readme
Safari 8.0.6 do not display events, but Google Chrome 43.0.2357.124 (64-bit) does.
What is the reason?
In README.md, it says to do the following:
At this point, the files from the fullcalendar project are in your asset pipeline's path... all you have to do is require them in the appropriate places. For instance, in your application.css.scss:
*= require fullcalendar
*= require fullcalendar.print
If you follow these instructions, you might have a difficult time changing the colors for events, because fullcalendar.print overrides the styles because it includes the following lines:
.fc-event {
background: #fff !important;
color: #000 !important;
}
I think the README.md should instruct users to only include *= require fullcalendar
in the application.css.scss, and then in their layout file, do the following:
<%= stylesheet_link_tag "fullcalendar.print", :media => "print" %>
I have your sample app with Sqlite working on my iMac. When I get the code into my own app, the calendar displays fine except I don't see any events.
Questions:
Thanks,
Dave
The calendar is working fine within my Rails 4 application until the user click an event and then the back button from the web browser.
In this case, the calendar is duplicated on the page.
How to make it working so that the user doesn't see multiple times the calendar when using the back button?
HI. Are locales included? https://fullcalendar.io/docs/text/locale/ Or I should download it separately? Because for now parameter locale: de
for example does nothing.
Thanks
Based on this question in stackoverflow
http://stackoverflow.com/questions/32993326/impossible-to-select-all-day-slots-with-fullcalendar
I can't figure out how to make the allDaySlot selectable.
Is it also possible to set up fullcalendar so that when the user selects the allDaySlot, the whole row concerning that day appears as selected ?
I noticed the rubygems version of the gem is dated. Any plans to push stable releases through that channel?
I read the useful and well written tutorial by Fernando Perales, which is linked in the readme.md file.
Since I would like to use fullcalendar-rails
for my application, and I am new with json
, I would like to ask some questions.
My Event
model has a place
attribute, which is the place where the event is held.
My goal is to have different calendars for different places, because each place has its own events.
Would it work if, after defining a search
method in the Event
model, I defined the instance variable @events
used by the index.json.builder
file as @events = Event.search(params[:search])
?
Is the index page of the RESTful Events resource the right place to define @events
?
What events will I see if I go to: localhost:3000/events.json
or to: localhost:3000/events
?
Since the show
action of the RESTful Events resource corresponds to the url /events/1
for the event with id=1
, I wonder if I will be routed correctly using for each event in the index.json.builder
file the html format which generates a url such as /events/1.html
. In fact, as common rails practice, I would insert the partial for the generic event in app/views/events/show.html.erb
Lastly: my users choose the day of the event with jQuery date picker, so the attribute event_date
will be saved as a string with format "yy-mm-dd"
: how can I set json start
and end
? Are they necessary?
Hello
It would like to suggest including a top level directory for the javascript files. At the moment one has to import "lang-all.js" and "gcal.js". Those names seem more common than "fullcallendar" and could lead to conflicts. Somethig like //= require fullcallendar/lang-all
seems better than //= require lang-all
.
Hi there!
Thanks for building this gem!
Would it be possible to add the ability to use the "locale" option provided in FullCalendar?
Here is the link to the FullCalendar Docs:
https://fullcalendar.io/docs/text/locale/
It would be much appreciated!
I'd be best to create a job on TravisCI to integrate test and the latest code from https://github.com/arshaw/fullcalendar. I'll look into that when I have a chance.
Is it helpful to offer styling guidance? So people can adjust SCSS/CSS to customize their implementations? Happy help with such documentation.
I tried to upgrade from 2.0.2.0 (which works fine) to 2.1.1.0. I followed the readme, changing the gcal requirement to fullcalendar/gcal. Bundled, restarted rails server. I get errors in the console that it cannot find variable moment, gcal and undefined method fullCalendar.
Downgrading fixes my problem in the meantime. I'm running Rails 4.1.6 on Ruby 2.1.4. Cheers!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.