MCPcopy
hub / github.com/formatjs/formatjs / getDurationInSeconds

Function getDurationInSeconds

packages/react-intl/components/relative.tsx:34–45  ·  view source on GitHub ↗
(unit?: Intl.RelativeTimeFormatUnit)

Source from the content-addressed store, hash-verified

32}
33
34function getDurationInSeconds(unit?: Intl.RelativeTimeFormatUnit): number {
35 switch (unit) {
36 case 'second':
37 return 1
38 case 'minute':
39 return MINUTE
40 case 'hour':
41 return HOUR
42 default:
43 return DAY
44 }
45}
46
47function valueToSeconds(
48 value?: number,

Callers 1

FormattedRelativeTimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected