Comparing version 0.1.1 to 0.1.2
@@ -63,2 +63,6 @@ ;(function() { | ||
date.setUTCMilliseconds(this.getMilliseconds(time)) | ||
var msg = date.toString() | ||
if (msg === 'Invalid Date') throw new Error(msg) | ||
return date | ||
@@ -65,0 +69,0 @@ }, |
{ | ||
"name": "ldap2date", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Parses LDAP Generalized Time Syntax", | ||
@@ -5,0 +5,0 @@ "main": "ldap2date.js", |
@@ -16,4 +16,6 @@ [![Build Status](https://travis-ci.org/rsolomo/ldap2date.js.png?branch=master)](https://travis-ci.org/rsolomo/ldap2date.js) | ||
Returns a new Date() object | ||
- `time` - String - A LDAP Generalized-Time string | ||
- `time` - A LDAP Generalized-Time string | ||
An error will be thrown if the time string cannot be parsed into a valid Date object. | ||
--- | ||
@@ -23,2 +25,2 @@ ### ldap2date.toGeneralizedTime(date) | ||
Returns a string in GeneralizedTime syntax | ||
- `date` - Date - A date object | ||
- `date` - A date object |
@@ -104,2 +104,10 @@ var assert = require('assert') | ||
}) | ||
it('should throw an Error if the parsed date is invalid', function() { | ||
assert.throws( | ||
function() { | ||
ldap2date.parse('A2013022819Z') | ||
}, Error | ||
) | ||
}) | ||
}) | ||
@@ -106,0 +114,0 @@ |
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
8587
194
25