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

How to format the DateTimeField control in RADEditor for SharePoint?

1 Answer 49 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Damien
Top achievements
Rank 1
Damien asked on 15 Oct 2007, 10:43 AM
How do I format the output of the DateTimeField control in RadEditorForMOSS?
I tried the DataFormatString but that is not a recognised public property.
The format I want is: 15 October 2007

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 17 Oct 2007, 11:48 AM
Hello Damien,

I assume that you are talking about the InserDate tool in RadEditor for MOSS. If this is so, you can override its function, however some Javascript coding is needed.

What you need to do is to modify the MOSSEditorTools.js file which can be found in your Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\4.4.0.0__1f131a624888eeed\RadControls\Editor\Scripts\7_2_0 folder (the name of the version folder might differ depending on your version).
Add the following function at the end of this file and modify it to suit your needs:

//change tool's action  
RadEditorCommandList["InsertDate"] = function(commandName, editor, oTool)  
{  
   //This is the original function. Modify it to match your requirements  
   var now = new Date();  
   value = " " + now.toLocaleDateString();  
   editor.PasteHtml(value);  
 
}; 

Reload your page after that and use the new function (you may need to reset IIS first).




Regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
WebParts for SharePoint
Asked by
Damien
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or