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 1.1.5 to 1.1.6

27

lib/datetimeWrapper.js

@@ -280,2 +280,17 @@ // == BDS2 LICENSE ==

/*
* Is this a valid date that matches the given date mask
* This is STRONGER validation than isValidDate and should be used
* e.g., when validating dates entered in forms
*
* @param {String} timestamp
* @param {String} mask [mask='MMMM D [at] h:mm a'] the date format mask to apply
*
* @return {Boolean}
*/
isValidDateForMask: function(timestamp, mask) {
var m = moment(timestamp, mask, true);
// Be careful, if `value` is empty, `m` can be null
return m && m.isValid();
},
/*
* Parse a timestamp string using provided format and (optionally) timezone into a JavaScript Date

@@ -316,2 +331,14 @@ *

/*
* Get the difference between two dates in the asked for units
*
* @param {String} timestampA
* @param {String} timestampB
* @param {String} units, a valid units identifier per moment e.g. days, hours, years ...
*
* @return {string} the difference between the two timestamps (which will be rounded down)
*/
dateDifference: function(timestampA, timestampB, units) {
return moment.utc(timestampA).diff(moment.utc(timestampB), units);
},
/*
*== CONSTANTS ==*

@@ -318,0 +345,0 @@ */

2

package.json
{
"name": "sundial",
"version": "1.1.5",
"version": "1.1.6",
"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