Closed SergiiVdovareize closed 7 years ago
All locales are included in the gem but you'll have to add the desired locales (or locales-all) manually to your application.js.erb, did you do that?
How should it look like?
#= require fullcalendar/locale/de
or
#= require fullcalendar/locale-all
?
Non of it works.
@gr8bit so what?
@sergeyvdovareize Here is my application.js file :
//= require fullcalendar
//= require fullcalendar/locale-all
And my html.erb file :
$(document).ready(function() {
$('#calendar').fullCalendar({
locale: 'fr'
});
}
Seems to work (tried with 'de' and it works too).
But i get the error couldn't find file 'fullcalendar/locale-all'
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
#= require fullcalendar
#= require fullcalendar/locale-all
#= require moment
Are you sure about your install ?
application.js :
//= require fullcalendar //= require fullcalendar/locale-all
custom.css.scss :
@import "fullcalendar";
Nothing in my application.css file.
My HTML page :
<div id="calendar"></div>
<script>
$(document).ready(function() {
$('#calendar').fullCalendar({
locale: 'fr',
events: [
{
title: '170668 - Sticker Color Renew',
start: '2017-07-10',
url: '<%= %>',
color: 'orange'
},
{
title: 'Event2',
start: '2017-07-26',
color: 'blue'
}
]
});
}
);</script>
My "require moment" is before requiring fullcalendar btw.
fullcalendar
works, moment
works, fullcalendar/locale-all
doesn't
I don't know what I could do wrong.
Where can I check that all locale files were downloaded during the bundle installation?
I think you can check in your gem installation folder.
I'm using RVM, and i have a .rvm directory at my user root path.
$>cd ~/.rvm/gems/ruby-2.2.3@Caprinae/gems/fullcalendar-rails-3.4.0.0/vendor/assets/javascripts/fullcalendar/
$>ls -l
➜ fullcalendar ls -l total 336 -rw-r--r-- 1 galeyte staff 5749 Jul 5 13:32 gcal.js drwxr-xr-x 69 galeyte staff 2346 Jul 5 13:32 lang -rw-r--r-- 1 galeyte staff 163823 Jul 5 13:32 locale-all.js
I've found out that I have a fullcalendar-rails-2.8.0.0
version instead of 3.4.0. Can't understand why. I didn't set a specific version in the gemfile: gem 'fullcalendar-rails'
Seems like it depends on some another gem
I didn't set a specific version either. Weird ! I included moment after fullcalendar
Looks like it was some cache issue. Thanks a lot!
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