How to use the i18n option in a Uikit Framework datepicker?

3

Hi, I would like to know how to use the i18n option of a Dateikicker of uikit.

on their official site they explain that they use a Json object. link

but I can not make it work.

my code is as follows:

<form class="uk-form">
<input type="text" data-uk-datepicker="{weekstart:0, format:'DD.MM.YYYY', i18n: { months:['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre']}}">
</form>

Could someone tell me how to use it correctly?

Thank you.

    
asked by Juan 24.02.2016 в 21:12
source

1 answer

1

Your code works well if I add online libraries:

<link href="http://getuikit.com/docs/css/uikit.docs.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://getuikit.com/docs/js/uikit.min.js"></script>
<script src="http://getuikit.com/src/js/components/datepicker.js"></script>

<form class="uk-form">
  <input type="text" data-uk-datepicker="{weekstart:0, format:'DD.MM.YYYY', i18n: { months:['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre']}}">
</form>

Probably the fault is that some of the files are not being included correctly. To fix it, make sure you are including everything you need:

  • jQuery
  • UIkit
  • UIkit Datepicker

If you are including all of them, check the error console to see if there are any 404 errors (the route may not be valid).

    
answered by 24.02.2016 / 21:25
source