This is a migrated thread and some comments may be shown as answers.
DatePicker Format in Ajax Binding
3 Answers 26 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Uchitha
Top achievements
Rank 1
Uchitha asked on 29 Sep 2011, 04:41 AM
Hi,

My intention is to use CurrentCulture  to globally tweak the date time formats for all controls across the whole web site. I use a global action filter to achieve this. (So that developers don't need to remember to 'format' date times in the views)

However this doesn't work quite as expected when I have a datetime inside an ajax binding grid (Works well in server bindings). The default rendering of the date time seem to respect 'shortDatePattern' property (i.e the date part changes when I change it at server side) but the time keeps getting rendered in "HH:mm:ss tt" format. I've tried changing almost all the related properties in CurrentCulture as well as hacking the $.telerik.cultureInfo object without success. 

I'm using Telerik Q1 2011 version.

Any update on this is appreciated.

Regards,
Uchitha.

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 29 Sep 2011, 11:17 AM
Hello Uchitha,

 
You will need to turn globalization of the ScriptRegistrar, like so:

Html.Telerik().ScriptRegistrar().Globalization(true);

Check this help topic for more information.

Kind regards,
Georgi Krustev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Uchitha
Top achievements
Rank 1
answered on 30 Sep 2011, 01:47 AM
Hi Georgi,
Yes I do have the Globalization setting in master page as follows;
Html.Telerik().ScriptRegistrar()
        .jQuery(false)
        .Globalization(true)
        .DefaultGroup(group => group
            .Add("~/Scripts/jquery-1.5.1.min.js")
            .Add("~/Scripts/jquery-ui-1.8.11.js")
            .Combined(true)
            .Compress(true)
            .CacheDurationInDays(365)

Please note that when I check $.telerik.cultureInfo object for the page which has the ajax bound grid, it does have expected value (i.e HH:mm) for properties like shortTime etc.. which I have changed. (I think it's evidence that globalization has taken place).

Regards,
Uchitha.
0
Georgi Krustev
Telerik team
answered on 30 Sep 2011, 04:48 PM
Hello Uchitha,

 
Could you please send me a simple test project, which I can investigate locally? Thus I will be able to observe the current implementation and advice you further.

Kind regards,
Georgi Krustev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Grid
Asked by
Uchitha
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Uchitha
Top achievements
Rank 1
Share this question
or