Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

lwc format date js

// formatDate.js
import { LightningElement } from 'lwc';
import LOCALE from '@salesforce/i18n/locale';

export default class FormatDate extends LightningElement {
    date = new Date(2020, 6, 7);
    formattedDate = new Intl.DateTimeFormat(LOCALE).format(this.date);
}
Source by developer.salesforce.com #
 
PREVIOUS NEXT
Tagged: #lwc #format #date #js
ADD COMMENT
Topic
Name
4+8 =