Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization of time/date with FullCalendar's language files #17

Merged
merged 3 commits into from
Nov 23, 2015

Conversation

laander
Copy link
Contributor

@laander laander commented Nov 22, 2015

This enables support for time/date localization through FullCalendar/Moment's language files.

Here's an example (from /examples/language.htm):

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="//cdn.timekit.io/booking-js/v1/booking.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.4.0/lang/de.js"></script>
<div id="bookingjs">
  <script type="text/javascript">
    TimekitBooking().init({
      name: 'Doc German',
      email: 'marty.mcfly@timekit.io',
      apiToken: 'XT1JO879JF1qUXXzmETD5ucgxaDwsFsd',
      calendar: '22f86f0c-ee80-470c-95e8-dadd9d05edd2',
      fullCalendar: {
        lang: 'de' // Specify the FullCalendar language shortname
      },
      localization: {
        timeDateFormat: false // Necessary to ignore the time/date preset
      }
    });
  </script>
</div>

It's a requirement that the language file is loaded after booking.js but before initialization. Individual settings can still be passed to FullCalendar and have precedence over the language settings.

Text strings on the booking page are not currently translatable, still researching for a proper implementation (perhaps extend the FullCalendar/Moment format?)

@laander
Copy link
Contributor Author

laander commented Nov 22, 2015

Fixes #15

@vistik
Copy link

vistik commented Nov 23, 2015

🎱

laander added a commit that referenced this pull request Nov 23, 2015
Localization of time/date with FullCalendar's language files
@laander laander merged commit 5fd66d5 into master Nov 23, 2015
@laander laander deleted the fullcalendar-language-support branch November 23, 2015 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants