Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 0.1.2 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": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc