Comparing version 1.2.1 to 1.3.0
{ | ||
"name": "bz-date", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "Date library for btrz", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -657,3 +657,3 @@ | ||
this.isEqual = function (date) { | ||
if (!(date instanceof BzDate)) { | ||
if (!(isBzDate(date))) { | ||
throw new Error("Invalid argument - date: " + date); | ||
@@ -686,2 +686,6 @@ } | ||
function isBzDate(bzDate) { | ||
return bzDate && bzDate.toLiteral !== undefined; | ||
} | ||
function BzDate(dateOrLiteralOrYear, formatOrOffsetOrMonth, offsetOrDay, hour, min, sec, msec, offset) { | ||
@@ -705,3 +709,3 @@ var _date = new Date(); | ||
// A BzDate object | ||
} else if (dateOrLiteralOrYear instanceof BzDate) { | ||
} else if (isBzDate(dateOrLiteralOrYear)) { | ||
_date = new Date(dateOrLiteralOrYear.getTime()); | ||
@@ -903,3 +907,3 @@ _timezoneOffset = dateOrLiteralOrYear.getTimezoneOffset(); | ||
this.isEqual = function (date) { | ||
if (!(date instanceof BzDate)) { | ||
if (!(isBzDate(date))) { | ||
throw new Error("Invalid argument - date: " + date); | ||
@@ -993,3 +997,3 @@ } | ||
BzDate.applyOffset = function (bzDate, applyOrAddOffset) { | ||
if (bzDate instanceof BzDate) { | ||
if (isBzDate(bzDate)) { | ||
var offset; | ||
@@ -1026,5 +1030,5 @@ | ||
BzDate.compare = function (bzDate1, bzDate2, applyOffsets) { | ||
if (!(bzDate1 instanceof BzDate)) { | ||
if (!(isBzDate(bzDate1))) { | ||
throw new Error("Invalid argument - bzDate1: " + bzDate1); | ||
} else if (!(bzDate2 instanceof BzDate)) { | ||
} else if (!(isBzDate(bzDate2))) { | ||
throw new Error("Invalid argument - bzDate2: " + bzDate2); | ||
@@ -1080,2 +1084,4 @@ } | ||
BzDate.isBzDate = isBzDate; | ||
/* | ||
@@ -1139,3 +1145,3 @@ * Date Format 1.2.3 | ||
toString: function (date, mask, offsetVisible) { | ||
if (!(date instanceof BzDate)) { | ||
if (!(isBzDate(date))) { | ||
throw new Error("Invalid argument - date: " + date); | ||
@@ -1142,0 +1148,0 @@ } else if (mask && (typeof mask !== "string")) { |
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
56909
1292