A common utils used within the
wix-design-systems
packages
The following helper functions can be used within the different wix-design-systems
packages:
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"
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"
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"
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"
returns formatted year
import { dateTimeFormat } from 'wix-design-systems-locale-utils';
const time = dateTimeFormat.getYear('ko', new Date('2022')); // "2022년"