Lightning framework provide $Locale which can be used to get current user preferred locale. For example you can get user preferred timezone, language, currency format etc.
In Spring'19, Salesforce introduces new date-time $Locale attributes for date- time formattingas mentioned below:
In Spring'19, Salesforce introduces new date-time $Locale attributes for date- time formattingas mentioned below:
- longDateFormat ("MMMM d, yyyy")
- shortDateFormat ("M/d/yyyy")
- shortDatetimeFormat ("M/d/yyyy h:mm a")
- shortTimeFormat ("h:mm a")
You can refer this global variable either directly in lightning component markup or in controller.js file.
Below is sample code:
Snapshot of lightning component
For detailed information on Locale global variable, please refer below URL:
$Locale in Lightning Component
For detailed information on Locale global variable, please refer below URL:
$Locale in Lightning Component
Hope this will help!!!
very interesting article. Thank you so much. I read a similar article from https://www.privatewriting.com/research-papers-for-sale about frameworks and I want to say that the material is useful in both places. just guys are professionally engaged in writing articles and essays
ReplyDelete