Skip to content

Latest commit

 

History

History
executable file
·
26 lines (18 loc) · 1.5 KB

README.md

File metadata and controls

executable file
·
26 lines (18 loc) · 1.5 KB

sf-date-fun

Showcase conversions and formatting of Dates and Times between Apex, Javascript, and LWC Base Components.

demo

Formatting Opinion

The LWC Base Component, lightning-formatted-date-time, is a wrapper around Intl.DateTimeFormatter. By abstracting the Intl.DateTimeFormatter away, it may be marginally easier to use.

Knowing neither of these, the learning curve is identical. But direct access to the Intl.DateTimeFormatter means more options and greater control.

Knowing both of these, it's a question of where would you like the complexity / config? Would you prefer to have more code in your template (base component) or would you prefer more code in javascript (Intl)?

Resources

  1. Epoch Time
  2. GMT vs UTC
  3. Javascript MDN
  4. Salesforce