Comparing version 3.2.1 to 3.2.2
@@ -618,3 +618,3 @@ // I18n.js | ||
I18n.interpolate = function(message, options) { | ||
if (message === null) { | ||
if (message == null) { | ||
return message; | ||
@@ -837,4 +837,8 @@ } | ||
var matches, convertedDate, fraction; | ||
// A date input of `null` or `undefined` will be returned as-is | ||
if (date == null) { | ||
return date; | ||
} | ||
// we have a date, so just return it. | ||
if (typeof(date) == "object") { | ||
if (typeof(date) === "object") { | ||
return date; | ||
@@ -985,8 +989,14 @@ } | ||
if (date.toString().match(/invalid/i)) { | ||
return date.toString(); | ||
// A date input of `null` or `undefined` will be returned as-is | ||
if (date == null) { | ||
return date; | ||
} | ||
var date_string = date.toString() | ||
if (date_string.match(/invalid/i)) { | ||
return date_string; | ||
} | ||
if (!format) { | ||
return date.toString(); | ||
return date_string; | ||
} | ||
@@ -993,0 +1003,0 @@ |
@@ -21,2 +21,10 @@ # Change Log | ||
## [3.2.2] - 2019-05-09 | ||
### Fixed | ||
- [JS] Return invalid date/time input values (null & undefined) as-is | ||
(Commit: https://github.com/fnando/i18n-js/commit/869d1689ed788ff50121de492db354652971c23d) | ||
## [3.2.1] - 2019-01-22 | ||
@@ -381,3 +389,4 @@ | ||
[Unreleased]: https://github.com/fnando/i18n-js/compare/v3.2.1...HEAD | ||
[Unreleased]: https://github.com/fnando/i18n-js/compare/v3.2.2...HEAD | ||
[3.2.2]: https://github.com/fnando/i18n-js/compare/v3.2.1...v3.2.2 | ||
[3.2.1]: https://github.com/fnando/i18n-js/compare/v3.2.0...v3.2.1 | ||
@@ -384,0 +393,0 @@ [3.2.0]: https://github.com/fnando/i18n-js/compare/v3.1.0...v3.2.0 |
{ | ||
"name": "i18n-js", | ||
"version": "3.2.1", | ||
"version": "3.2.2", | ||
"description": "A javascript library similar to Ruby on Rails i18n gem", | ||
@@ -5,0 +5,0 @@ "author": "Nando Vieira", |
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
82014
936