How to use the fecha.masks function in fecha

To help you get started, we’ve selected a few fecha examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github home-assistant / home-assistant-polymer / js / util.js View on Github external
import computeStateDisplay from './common/entity/compute_state_display.js';
import computeStateName from './common/entity/compute_state_name.js';
import coverIcon from './common/entity/cover_icon.js';
import domainIcon from './common/entity/domain_icon.js';
import featureClassNames from './common/entity/feature_class_names.js';
import sensorIcon from './common/entity/sensor_icon.js';
import sortByName from './common/entity/states_sort_by_name.js';
import stateCardType from './common/entity/state_card_type.js';
import stateIcon from './common/entity/state_icon.js';
import stateMoreInfoType from './common/entity/state_more_info_type.js';
import timerTimeRemaining from './common/entity/timer_time_remaining.js';

const language = navigator.languages ?
  navigator.languages[0] : navigator.language || navigator.userLanguage;

fecha.masks.haDateTime = `${fecha.masks.shortTime} ${fecha.masks.mediumDate}`;

window.hassUtil = {
  // const
  DEFAULT_ICON: DEFAULT_DOMAIN_ICON,
  OFF_STATES: STATES_OFF,
  DOMAINS_WITH_NO_HISTORY: DOMAINS_MORE_INFO_NO_HISTORY,

  // config
  computeLocationName,
  isComponentLoaded,

  // datetime
  durationToSeconds,
  formatDate: dateObj => formatDate(dateObj, language),
  formatDateTime: dateObj => formatDateTime(dateObj, language),
  formatTime: dateObj => formatTime(dateObj, language),

fecha

Date formatting and parsing

MIT
Latest version published 3 years ago

Package Health Score

76 / 100
Full package analysis