Skip to main content
added 498 characters in body
Source Link
Jayant Das
  • 30.7k
  • 3
  • 42
  • 68

You need to use the format attribute to display the output however you want. In your case to be able to display it as 09/17/2018, you can just have it as:

<ui:outputDate value="{!v.myDataList[0].ExpirationDate__c}" format="MM/DD/YYYY"/>

Refer to the documentation's specification for details.


If you need to support User's locale, use lightning:formattedDate instead, which allows to format the date based on User's locale.

A lightning:formattedDateTime component displays formatted date and time. This component uses the Intl.DateTimeFormat JavaScript object to format date values. The locale set in the app's user preferences determines the formatting.

You need to use the format attribute to display the output however you want. In your case to be able to display it as 09/17/2018, you can just have it as:

<ui:outputDate value="{!v.myDataList[0].ExpirationDate__c}" format="MM/DD/YYYY"/>

Refer to the documentation's specification for details.

You need to use the format attribute to display the output however you want. In your case to be able to display it as 09/17/2018, you can just have it as:

<ui:outputDate value="{!v.myDataList[0].ExpirationDate__c}" format="MM/DD/YYYY"/>

Refer to the documentation's specification for details.


If you need to support User's locale, use lightning:formattedDate instead, which allows to format the date based on User's locale.

A lightning:formattedDateTime component displays formatted date and time. This component uses the Intl.DateTimeFormat JavaScript object to format date values. The locale set in the app's user preferences determines the formatting.

Source Link
Jayant Das
  • 30.7k
  • 3
  • 42
  • 68

You need to use the format attribute to display the output however you want. In your case to be able to display it as 09/17/2018, you can just have it as:

<ui:outputDate value="{!v.myDataList[0].ExpirationDate__c}" format="MM/DD/YYYY"/>

Refer to the documentation's specification for details.