We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

FileExplorer change date format

Thread ID:

Created:

Updated:

Platform:

Replies:

127744 Dec 6,2016 11:08 AM UTC Dec 8,2016 01:25 PM UTC ASP.NET MVC 1
loading
Tags: FileExplorer
Polly Fahey
Asked On December 6, 2016 11:08 AM UTC

Hi,

Is it possible to change the format of dates to 'DD/MM/YYYY' in the file explorer?

Thank you
Polly

Balamurugan P [Syncfusion]
Replied On December 8, 2016 01:25 PM UTC

Hi Polly, 

Thanks for using Syncfusion Products.  

Yes, it is possible to customize the format of dates 'DD/MM/YYYY' in the ileExplorer control. Usually these date details will be received from file handling service, so you can customize these date formats in the response of the file handling functionalities of FileExplorer.  
  
You can pass the file handling operations response to the following “ConvertDateFormat” function, customize it as per your requirement and finally  return the customized AJAX response.  
  
  
        ConvertDateFormat(operation.Read(args.Path, args.ExtensionsAllow)); 
  
  
        public virtual FileExplorerResponse ConvertDateFormat(object response, bool getDetails= false) 
        { 
            FileExplorerResponse ReadResponse = (FileExplorerResponse) response; 
  
            if (getDetails) 
            { 
                var listResponse = ReadResponse.details.ToList(); 
                for (int i = 0; i < listResponse.Count; i++) 
                { 
                    DateTime created = Convert.ToDateTime(listResponse[i].Created); 
                    listResponse[i].Created = created.ToString("dd/MM/yyyy"); 
                    DateTime modified = Convert.ToDateTime(listResponse[i].Modified); 
                    listResponse[i].Modified = modified.ToString("dd/MM/yyyy"); 
                } 
                ReadResponse.details = listResponse; 
            } 
            else 
            { 
                var listResponse = ReadResponse.files.ToList(); 
                for (int i = 0; i < listResponse.Count; i++) 
                { 
                    DateTime dt = Convert.ToDateTime(listResponse[i].dateModified); 
                    listResponse[i].dateModified = dt.ToString("dd/MM/yyyy"); 
                } 
                ReadResponse.files = listResponse; 
            } 
            
            return ReadResponse; 
        } 
  
  

We have prepared a sample based on this and you can find the sample under the following location:  

  
Please let us know if you require any further assistance. 
  
Regards, 
Balamurugan P 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;