wix-design-systems-locale-utils
TypeScript icon, indicating that this package has built-in type declarations

1.160.0 • Public • Published

wix-design-systems-locale-utils

A common utils used within the wix-design-systems packages

Locale utils

The following helper functions can be used within the different wix-design-systems packages:

getShortDate

returns short date format approved by Wix Localization team

import { dateTimeFormat } from 'wix-design-systems-locale-utils';

const date = dateTimeFormat.getShortDate('lt', new Date('2021/08/13')); //"2021-08-13"

getMediumDate

returns medium date format approved by Wix Localization team

import { dateTimeFormat } from 'wix-design-systems-locale-utils';

const date = dateTimeFormat.getMediumDate('tr', new Date('2021/08/13')); //"21 Tem 2021"

getShortTime

returns short time format approved by Wix Localization team

import { dateTimeFormat } from 'wix-design-systems-locale-utils';

const time = dateTimeFormat.getShortTime('lt', new Date('2021/08/12 16:45')); //"16:45"

getLongTime

returns long time format approved by Wix Localization team

import { dateTimeFormat } from 'wix-design-systems-locale-utils';

const time = dateTimeFormat.getLongTime('tr', new Date('2021/08/12 16:45')); //"ÖS 4:45 GMT+3"

getYear

returns formatted year

import { dateTimeFormat } from 'wix-design-systems-locale-utils';

const time = dateTimeFormat.getYear('ko', new Date('2022')); // "2022년"

Readme

Keywords

none

Package Sidebar

Install

npm i wix-design-systems-locale-utils

Weekly Downloads

1,107

Version

1.160.0

License

none

Unpacked Size

151 kB

Total Files

99

Last publish

Collaborators

  • arielh
  • falconci
  • yurynix
  • itai.benda
  • wix-ci
  • wix-ambassador
  • shahata
  • netanelgilad
  • wix-ci-publisher
  • wix-bi-publisher