How to format the DateTimeField control in RADEditor for SharePoint?

2 posts, 0 answers
  1. Damien
    Damien avatar
    3 posts
    Member since:
    Jun 2005

    Posted 15 Oct 2007 Link to this post

    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
  2. Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 17 Oct 2007 Link to this post

    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\\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();  

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

    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top