react-i18nify
Advanced tools
Comparing version 1.11.10 to 1.11.11
@@ -137,5 +137,10 @@ 'use strict'; | ||
if (moduleAvailable('moment')) { | ||
var moment = require('moment'); | ||
require('moment/min/locales'); | ||
return moment(value, options.parseFormat, this._locale, Boolean(options.strictParse)).format(this.t(options.dateFormat)); | ||
try { | ||
var moment = require('moment'); | ||
require('moment/min/locales'); | ||
return moment(value, options.parseFormat, this._locale, Boolean(options.strictParse)).format(this.t(options.dateFormat)); | ||
} catch (e) { | ||
console.error('Date formatting with moment.js failed', e); | ||
return ''; | ||
} | ||
} | ||
@@ -142,0 +147,0 @@ console.error('Date formatting failed, please install moment.js'); |
{ | ||
"name": "react-i18nify", | ||
"version": "1.11.10", | ||
"version": "1.11.11", | ||
"description": "Simple i18n translation and localization components and helpers for React applications.", | ||
@@ -5,0 +5,0 @@ "main": "./build/index.js", |
@@ -125,10 +125,15 @@ /* eslint global-require: "off" */ | ||
if (moduleAvailable('moment')) { | ||
const moment = require('moment'); | ||
require('moment/min/locales'); | ||
return moment( | ||
value, | ||
options.parseFormat, | ||
this._locale, | ||
Boolean(options.strictParse), | ||
).format(this.t(options.dateFormat)); | ||
try { | ||
const moment = require('moment'); | ||
require('moment/min/locales'); | ||
return moment( | ||
value, | ||
options.parseFormat, | ||
this._locale, | ||
Boolean(options.strictParse), | ||
).format(this.t(options.dateFormat)); | ||
} catch (e) { | ||
console.error('Date formatting with moment.js failed', e); | ||
return ''; | ||
} | ||
} | ||
@@ -135,0 +140,0 @@ console.error('Date formatting failed, please install moment.js'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38798
722