New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

timezone-offset-to

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timezone-offset-to - npm Package Compare versions

Comparing version 0.0.0 to 0.1.0

44

index.js

@@ -1,22 +0,32 @@

var parse = function(offset) {
offset = offset || ""
var tz = 0
var tzRX = /(-?)(\d{1,2}):??(\d{2})/
var match = offset.match(tzRX)
if (match) tz = parseInt(match.slice(1,4).join(''), 10)
return tz
}
!function (name, definition) {
if (typeof module != 'undefined') module.exports = definition()
else if (typeof define == 'function' && typeof define.amd == 'object') define(definition)
else this[name] = definition()
}('tzto', function () {
var tzTo = module.exports = {
var parse = function(offset) {
offset = offset || ""
var tz = 0
var tzRX = /(-?)(\d{1,2}):??(\d{2})/
var match = offset.match(tzRX)
if (match) tz = parseInt(match.slice(1,4).join(''), 10)
return tz
}
minutes: function(offset) {
var tz = parse(offset)
return (((tz / 100) | 0) * 60) + tz % 100
},
var tzto = {
hours: function(offset) {
var tz = parse(offset)
return ((tz / 100) | 0) + ((tz % 100) / 60)
minutes: function(offset) {
var tz = parse(offset)
return (((tz / 100) | 0) * 60) + tz % 100
},
hours: function(offset) {
var tz = parse(offset)
return ((tz / 100) | 0) + ((tz % 100) / 60)
}
}
}
return tzto
})
{
"name": "timezone-offset-to",
"version": "0.0.0",
"version": "0.1.0",
"description": "convert a timezone offset to a numerical value",

@@ -5,0 +5,0 @@ "main": "index.js",

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