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

blear.utils.date

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blear.utils.date - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

package.json
{
"name": "blear.utils.date",
"version": "1.0.4",
"version": "1.0.5",
"description": "date utils",

@@ -5,0 +5,0 @@ "scripts": {

@@ -64,2 +64,17 @@ /**

/**
* 将 id 解析为日期对象
* @param id
* @returns {Date}
*/
exports.fromId = function (id) {
var str = id + '';
var year = number.parseInt(str.slice(0, 4));
var month = number.parseInt(str.slice(4, 6)) - 1;
var date = number.parseInt(str.slice(-2));
return new Date(year, month, date);
};
/**
* 包装 Date 实例

@@ -66,0 +81,0 @@ * @param date

@@ -23,2 +23,8 @@ /**

it('.fromId', function () {
var d = date.fromId(20160101);
expect(date.id(d)).toEqual(20160101);
});
it('.parse', function () {

@@ -25,0 +31,0 @@ expect(isNaN(date.parse('...'))).toEqual(false);

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