This is a migrated thread and some comments may be shown as answers.

language localization

4 Answers 1191 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Ugo
Top achievements
Rank 1
Ugo asked on 29 Oct 2011, 06:03 PM
I am trying to localize the datePicker widget to show the date in Italian format and get 
the text shown on the popup in Italian as well.

here is what I load in the <head> section:
<script src="/os/jquery/jquery-1.6.4.min.js" type="text/javascript"></script>
<!-- tried also jquery 1.6.2, but 1.6.4 fixes an issue with modal popup window -->

<link rel="stylesheet" href="/os/kendo/styles/kendo.common.min.css" type="text/css" />
<link rel="stylesheet" href="/os/kendo/styles/kendo.kendo.min.css" type="text/css" />
<script src="/os/kendo/js/kendo.all.min.js" type="text/javascript"></script>
<script src="/os/kendo/js/cultures/kendo.culture.it-IT.js" type="text/javascript"></script>

<input
id="dataInizio" name="dataInizio" value="31/10/2011" size="12" maxlength="10" /> <script type="text/javascript"> $(document).ready(function(){$("#dataInizio").kendoDatePicker();}); $("#dataInizio").kendoDatePicker({format: "dd/MM/yyyy"}); </script> Actually, when the page loads you can see the date - properly formatted - for a while, then it disappear, showing the field empty. I am probably doing something wrong can you please give an example about how localize in different 'cultures'? Thanks!

4 Answers, 1 is accepted

Sort by
0
Koosha
Top achievements
Rank 1
answered on 31 Oct 2011, 01:35 PM
I have problem too, please help about  language localization !
tanx

0
Georgi
Top achievements
Rank 1
answered on 04 Nov 2011, 05:21 PM
The default culture is "en-US". Hence the "31/10/2011" value is not correct date and that is why the input is cleared.
You will need to use kendo.culture() to set the culture. Check this jsFiddle demo.
0
Georgi
Top achievements
Rank 1
answered on 04 Nov 2011, 05:22 PM
The default culture is "en-US". Hence the "31/10/2011" value is not correct date and that is why the input is cleared.
You will need to use kendo.culture() to set the culture. Check this jsFiddle demo.
0
Ugo
Top achievements
Rank 1
answered on 06 Nov 2011, 11:44 AM
Thanks Georgi,

it works!
For other people willing to customize their date pickers is good to know that you also need to load the culture script in your <head> section as follow:

<head> ... <script src="/os/jquery/jquery-1.6.4.min.js" type="text/javascript"></script> <link rel="stylesheet" href="/os/kendo/styles/kendo.common.min.css" type="text/css" /> <link rel="stylesheet" href="/os/kendo/styles/kendo.kendo.min.css" type="text/css" /> <script src="/os/kendo/js/kendo.all.min.js" type="text/javascript"></script> <script src="/os/kendo/js/cultures/kendo.culture.it-IT.js" type="text/javascript"></script> ... </head> Thank you so much!
Ugo


Tags
Date/Time Pickers
Asked by
Ugo
Top achievements
Rank 1
Answers by
Koosha
Top achievements
Rank 1
Georgi
Top achievements
Rank 1
Ugo
Top achievements
Rank 1
Share this question
or