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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Default date format

Thread ID:

Created:

Updated:

Platform:

Replies:

143423 Mar 20,2019 03:19 AM UTC Mar 20,2019 11:13 AM UTC Angular - EJ 2 1
loading
Tags: DateTimePicker
Sahal
Asked On March 20, 2019 03:19 AM UTC

Hi,

Currently if I initialize a ejs-datepicker by default the dateformat is set to 'm/dd/yyyy' . I know I can change it by  using the format attribute. What I need to know is there a way to set application wide default format rather than for each component.

Also is there a way to create a masked date picker which looks like the image below

enter image description here

Deepa Loganathan [Syncfusion]
Replied On March 20, 2019 11:13 AM UTC

Hi Sahal,  
 
Thanks for contacting Syncufsion support.  
 
Query: Set common format for all the controls 
 
We would like to let you know that the date format and the number formats of the EJ controls will be set based on the applications’ culture set by using setCulture method. The default culture is ‘en-Us’ and there is no default option to override the date format other than the format API.  
 
Rather, you could set the default format by using a common property in your application as given below. 
 
[App.component.html] 
 
export class DefaultDateTimePickerComponent { 
 
    public date: Object = new Date(); 
 
    public format:string = "dd/MM/yyyy HH:mm" // common format as a model value. 
 
} 
 
[App.component.ts] 
 
<div id="control_wrapper"> 
        <ejs-datetimepicker [format]="format"></ejs-datetimepicker> 
        <ejs-datepicker [format]="format"></ejs-datepicker> 
    </div> 
 
 
Query: Mask enabled Datepicker 
 
Currently, Datetimepicker component does not support masking of date input. However, we have considered this as a feature request and logged in our database to implement it in any of our upcoming releases.   
  
Please follow the below link to keep track of the status of this feature.   
  
Feedback portal link:  
  
Please do cast your vote to show your interest for this feature. If you have any specific requirement for this feature in your application, you can describe it in the comments section. We will consider this in defining this feature in our initial implementation itself.  
 
Please let us know if you have any further queries. 
 
Regards,  
Deepa L. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon