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

How to set the date format to dd-MMM-yyyy

Thread ID:

Created:

Updated:

Platform:

Replies:

118385 Mar 4,2015 01:21 PM UTC Sep 7,2015 10:33 AM UTC JavaScript 5
loading
Tags: ejDatePicker
Tejaswini
Asked On March 4, 2015 01:21 PM UTC

Hi,
 I am using the syncfusion datepicker to display date of birth of user in my form. I want to display the date format as dd-MMM-yyyy(5-Feb-2015) in the view and input. I am working with angularjs and written code in html file as,

<input id="datepick" class="col-md-8 col-lg-8" ej-datepicker  e-value="employee.birthdate" e-format="{0:dd-MMM-yyyy}" ej-change="changeformat()" e-enableStrictMode="true" />

To display date to view, i have used {{employee.birthdate | date: "dd-MMM-yyyy"}} 

In js file, I have included,

 $scope.changeformat = function () {

        $scope.employee.birthdate = $filter('date')($scope.employee.birthdate, "dd MMM yyyy");
    };
But, the above code is not working. It is still displaying the date in 3/2/2015 format. How can i change the date format to dd-MMM-yyyy  using angularjs?

Thank you.

Harikrishnan P [Syncfusion]
Replied On March 6, 2015 06:30 AM UTC

Hi Tejaswini,

Thanks for using  Syncfusion products.

Query : How to set the date format to dd-MMM-yyyy

We would like to inform you that, for specifying date format we need to use the property ‘e-dateformat’. On analysing your code, it is found that you have mentioned as ‘e-format’ while declaring the datepicker. Please use the code as shown below to resolve your issue.

<input id="datepick" class="col-md-8 col-lg-8" ej-datepicker  e-value="dateValue" e-dateformat="dd-MMM-yyyy" e-change="changeformat()" e-enableStrictMode="true" />

You can refer the following common user guide for JavaScript to know more about getting started with our components. Under each components we have provided “Concepts and features” section which explains about the features of the particular component.

http://help.syncfusion.com/web

You can also refer the following class reference link for JavaScript, which showcases all the properties, methods and events supported by each component.

http://help.syncfusion.com/cr/js

Please let us know if you have further queries.

Regards,

HariKrishnan



Tejaswini
Replied On March 10, 2015 04:37 AM UTC

Thank you Harikrishanan. The e-dateformat works correct.

Sasikala Nagarajan [Syncfusion]
Replied On March 12, 2015 03:38 AM UTC

Hi Tejaswini,
Thanks for the udpate.

Please get back to us if you need further assistance. We will be happy to help you out.

Regards,

Sasikala Nagarajan



Jony Green
Replied On September 4, 2015 03:59 AM UTC

I use this online service to format my js code, it's free.


Harikrishnan P [Syncfusion]
Replied On September 7, 2015 10:33 AM UTC

Hi Jony,

Thanks for your suggestion. If you need any assistance regarding our components, please get back to us and we will be happy to help you.

Regards,
HariKrishnan

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

;