CroudTech / vue-fullcalendar

FullCalendar Wrapper for vue
MIT License
482 stars 100 forks source link

changhe locale ('fa') #21

Closed davodaslanifakor closed 7 years ago

davodaslanifakor commented 7 years ago

Hi dear i want Chang locale and calendar to Persian in vue-fullcalendar... so i don't now how do that in vue please Guide me... Tnx....

BrockReece commented 7 years ago

You can pass through custom config with the config prop.

Something like this should work

<full-calendar :events="events" :config="{locale: 'fa'}"></full-calendar>

and then you should be able to import the locale files that you need in the parent component.

<script>
  import 'fullcalendar/dist/locale/fa.js'

  export default {
     ...
</script>

locale docs

ergonomicus commented 7 years ago

What if we have no parent component? Is it possible?

I've tried at the end of body tag, but I get error since moment.js isn't loaded...

BrockReece commented 7 years ago

How are you loading everything?

ergonomicus commented 7 years ago

I am using Laravel, so webpack is doing it's thing... But I have no parent component, I just use <full-calendar :events="{{ json_encode($events) }}" :config="{{ json_encode($config) }}"></full-calendar> I've managed to get it loading by putting it in main app.js, AFTER require('vue-full-calendar'). Since it's small file I don't mind having it on each page, anyway.

Thank you.

P.S. Curly braces are for blade templating engine, not for Vue :)

davodaslanifakor commented 7 years ago

Friends merely translated text, but not the jalali(Persian) calendar... @BrockReece @ergonomicus

BrockReece commented 7 years ago

@davodaslanifakor I don't think fullcalendar provides a way to change to a jalali calendar. There looks like there are a few forks of fullcalender that solve this issue.

@ergonomicus That would have been where I would have put it too so glad that works.

I am closing this issue as I have answered the original query and it looks like another issue has been opened for the Jalali calendar.