You need to sign in to do that
Don't have an account?
Michael Degn Jensen
Aura Component DateTime not showing correct format
Hi,
I am showing the value of a date/time field but the format is off.
This is what I would like it to show (as show on the Page Layout):
However this is what it looks like in my component:
My code:
Thanks,
Michael
I am showing the value of a date/time field but the format is off.
This is what I would like it to show (as show on the Page Layout):
However this is what it looks like in my component:
My code:
<lightning:formattedDateTime value="{!task.Task_LastModifiedDate__c}" timeZone="{!$Locale.timezone}" year="numeric" month="numeric" day="numeric" hour="2-digit" minute="2-digit" hour12="false"/>Basically I just want to show the standard date/time format.
Thanks,
Michael
It works based on user datetime format settings
https://help.salesforce.com/articleView?id=000324092&type=1&mode=1 (https://help.salesforce.com/articleView?id=000324092&type=1&mode=1)
This is how it looks for me
Thanks
Ramesh
But it doesn't make sense that one field is showing format dd-mmm-yyyy and the other dd.m.yyyy?
Thanks,
Michael
I think to format date as you need you should use javascript API formatDate() method from $A.localizationService and save it to aura attribute to display
please look at this page in aura documentation https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_cb_format_dates.htm