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.
Files changed (2) hide show
  1. package/index.js +3 -5
  2. 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] = relativeTimeDiff(value)
397
- return relativeTimeFormat.format(duration, unit)
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
  `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluent-transpiler",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Transpile Fluent (ftl) files into optimized, tree-shakable, JavaScript EcmaScript Modules (esm).",
5
5
  "main": "index.js",
6
6
  "type": "module",