🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

sundial

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sundial - npm Package Compare versions

Comparing version

to
0.1.3

27

lib/datetimeWrapper.js

@@ -62,2 +62,29 @@ // == BDS2 LICENSE ==

/*
* Is this a valid date?
*
* @ param {String} timestamp
*
* @ return {Boolean}
*/
isValidDate: function(timestamp) {
var m = usedMoment(timestamp);
// Be careful, if `value` is empty, `m` can be null
return m && m.isValid();
},
/*
* How long ago is this date from now
*
* @ param {String} timestamp
* @ param {String} period years, months, weeks, days, hours, minutes, and seconds
*
* @ return {Number}
*/
timeAgo: function(timestamp,period) {
if(period){
var today = usedMoment();
return today.diff(timestamp, period);
}
return null;
},
/*
* Format the given timestamp for storage

@@ -64,0 +91,0 @@ *

2

package.json
{
"name": "sundial",
"version": "0.1.2",
"version": "0.1.3",
"description": "Tidepool's datetime wrapper",

@@ -5,0 +5,0 @@ "keywords": [