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

$.telerik.formatString defect ?

4 Answers 138 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Cookie Monster
Top achievements
Rank 1
Cookie Monster asked on 22 Mar 2010, 07:40 AM
Hello,

Could you please investigate why this line of code
$.telerik.formatString('{0:dd/MM/yyyy}', objCustomer.DivestmentDate)
works only if I reference both "~/Scripts/telerik.common.js" and "~/Scripts/telerik.calendar.js"
although the function's definition is in "~/Scripts/telerik.common.js". So logically, just that file should be referenced...

PS
maybe it's a good idea to add comments to the function in order to avoid loosing hours of debugging and understanding this feature ?

4 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 22 Mar 2010, 12:35 PM
Hello, Cookie Monster!

Since date formatting isn't used in navigational components like the Menu, PanelBar, etc, we decided to include the related code (~120 LoC) only for the components that need it (Calendar, DatePicker, Grid). And since the Grid includes the DatePicker, and the DatePicker includes the Calendar, the telerik.calendar.js file was the obvious place where the code went.

Since it isn't documented, it's understandable that it's hard to use - we didn't have the intent to make the function public. Thank you for pointing out its usefulness - we might provide documentation for it and for other methods that may come in handy. Also, you could have asked how to format dates on the client instead of wasting your time - we would have loved to explain our reasoning and to discuss it with you.

All the best,
Alex Gyoshev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Cookie Monster
Top achievements
Rank 1
answered on 22 Mar 2010, 11:47 PM
Hi, thanks for that.
But everything was ok for the Telerik Beta code.. Unfortunately, ones I switched into Release some(!) pages stopped working.. That was a confusion.. On some pages ScripRegistrar actually put calendar in - and function was working fine,, For some pages that was not the case.. So, I assumed first, that your code is fine and start debugging my own one..
All I'm saying is that it might be usefull having some kind of document like 'release notes' with the list of changes or something like that...
0
Kyle Nunery
Top achievements
Rank 1
answered on 24 Aug 2010, 01:44 AM
Is there functionality to format time on the client side in a localized fashion?
0
David Bailey
Top achievements
Rank 1
answered on 26 Nov 2010, 08:44 PM
I get problems in grids when formatting a date by a custom type or even using {0:shortDate}.  The result is always a Long Date Time format.  This was working before switching to MVC2.

Here is a snippet
builder = builder.Name(Model.Name).Columns 
     columns => 
     
           columns.Add(i => i.NavigationLink).Title("").Filterable(false).Width(45); 
           if(HttpContext.User.IsInRole(RoleNames.COMPLIANCE_APPROVERS)) 
                columns.Add(i => i.UserName).Title("User"); 
                //formatDate is from a configuration value assume "{0:MM-dd-yyyy}"
                //DueDate is nullable datetime propery
                columns.Add(i => i.DueDate).Title("Due Date").Format(formatDate); 
                columns.Add(i => i.ApprovedBy).Title("Approved By"); 
                columns.Add(i => i.ReportStatus).Title("Status"); 
           
)
Tags
General Discussions
Asked by
Cookie Monster
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Cookie Monster
Top achievements
Rank 1
Kyle Nunery
Top achievements
Rank 1
David Bailey
Top achievements
Rank 1
Share this question
or