bokmann / fullcalendar-rails

an asset gem containing Adam Shaw's excellent fullcalendar jquery plugin
MIT License
463 stars 155 forks source link

Are locales included? #81

Closed SergiiVdovareize closed 7 years ago

SergiiVdovareize commented 7 years ago

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

gr8bit commented 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?

SergiiVdovareize commented 7 years ago

How should it look like? #= require fullcalendar/locale/de or #= require fullcalendar/locale-all? Non of it works.

SergiiVdovareize commented 7 years ago

@gr8bit so what?

galettan commented 7 years ago

@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).

SergiiVdovareize commented 7 years ago

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
galettan commented 7 years ago

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>
galettan commented 7 years ago

My "require moment" is before requiring fullcalendar btw.

SergiiVdovareize commented 7 years ago

fullcalendar works, moment works, fullcalendar/locale-all doesn't I don't know what I could do wrong.

SergiiVdovareize commented 7 years ago

Where can I check that all locale files were downloaded during the bundle installation?

galettan commented 7 years ago

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

SergiiVdovareize commented 7 years ago

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

galettan commented 7 years ago

I didn't set a specific version either. Weird ! I included moment after fullcalendar

SergiiVdovareize commented 7 years ago

Looks like it was some cache issue. Thanks a lot!