Extend

Docs | Utilities | Javascript | Dates

Previously MomentJS was used, but is being deprecated, dayjs seems a viable alternative - https://day.js.org/

Being Loaded as (not seeing it documented like this):

$(document).ready( () => {
  dayjs.extend(dayjs_plugin_localeData);
  dayjs.extend(dayjs_plugin_localizedFormat);
  dayjs.extend(dayjs_plugin_utc);
  dayjs.extend(dayjs_plugin_timezone);
  dayjs.extend(dayjs_plugin_updateLocale);
  // dayjs.extend(dayjs_plugin_customParseFormat); // buggy as at 21/9/2020

  if ('' !== _.timezone) {
    dayjs.tz.setDefault(_.timezone);

  }

});

Note: that dayjs is not fully available until DOMContentLoaded, using jQuery here ..

$(document).ready( () => {
  ( _ => {
    $('#date_example_1').html( _.dayjs( '04/8/2013').format('L'));

  }) (_brayworth_);

});

Result:

$(document).ready( () => {
  ( _ => {
    $('#date_example_2').html( _.dayjs( '04/8/2013').format('LL'));

  }) (_brayworth_);

});

Result:

$(document).ready( () => {
  ( _ => {
    $('#date_example_3').html( _.dayjs( '04/8/2013', 'DD/MM/YYYY').format('ddd LL'));

  }) (_brayworth_);

});

Result: