wix-design-systems-locale-utils
v1.160.0
Published
> A common utils used within the `wix-design-systems` packages
Downloads
4,672
Maintainers
Keywords
Readme
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년"