fluent-transpiler 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -393,11 +393,9 @@ const formatTime = (value) => {
|
|
|
393
393
|
if (typeof value === 'string') value = new Date(value)
|
|
394
394
|
if (isNaN(value.getTime())) return value
|
|
395
395
|
try {
|
|
396
|
-
const [duration, unit] =
|
|
397
|
-
return
|
|
398
|
-
} catch (e) {
|
|
399
|
-
return dateTimeFormat.format(value)
|
|
400
|
-
}
|
|
396
|
+
const [duration, unit] = __relativeTimeDiff(value)
|
|
397
|
+
return new Intl.RelativeTimeFormat(lang, options).format(duration, unit)
|
|
398
|
+
} catch (e) {}
|
|
401
399
|
return new Intl.DateTimeFormat(__locales, options).format(value)
|
|
402
400
|
}
|
|
403
401
|
`
|