Socket
Socket
Sign inDemoInstall

dateformat

Package Overview
Dependencies
0
Maintainers
6
Versions
42
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.0 to 4.0.1

21

lib/dateformat.js

@@ -21,2 +21,4 @@ "use strict";

var _arguments = arguments;
var dateFormat = function () {

@@ -29,3 +31,3 @@ var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|"[^"]*"|'[^']*'/g;

// You can't provide utc if you skip other args (use the 'UTC:' mask prefix)
if (arguments.length === 1 && kindOf(date) === "string" && !/\d/.test(date)) {
if (_arguments.length === 1 && kindOf(date) === "string" && !/\d/.test(date)) {
mask = date;

@@ -208,2 +210,3 @@ date = undefined;

shortDate: "m/d/yy",
paddedShortDate: "mm/dd/yyyy",
mediumDate: "mmm d, yyyy",

@@ -228,3 +231,3 @@ longDate: "mmmm d, yyyy",

function pad(val, len) {
var pad = function pad(val, len) {
val = String(val);

@@ -238,3 +241,3 @@ len = len || 2;

return val;
}
};
/**

@@ -250,3 +253,3 @@ * Get the ISO 8601 week number

function getWeek(date) {
var getWeek = function getWeek(date) {
// Remove time components of date

@@ -266,3 +269,3 @@ var targetThursday = new Date(date.getFullYear(), date.getMonth(), date.getDate()); // Change date to Thursday same week

return 1 + Math.floor(weekDiff);
}
};
/**

@@ -277,3 +280,3 @@ * Get ISO-8601 numeric representation of the day of the week

function getDayOfWeek(date) {
var getDayOfWeek = function getDayOfWeek(date) {
var dow = date.getDay();

@@ -286,3 +289,3 @@

return dow;
}
};
/**

@@ -295,3 +298,3 @@ * kind-of shortcut

function kindOf(val) {
var kindOf = function kindOf(val) {
if (val === null) {

@@ -314,3 +317,3 @@ return "null";

return {}.toString.call(val).slice(8, -1).toLowerCase();
}
};

@@ -317,0 +320,0 @@ if (typeof define === "function" && define.amd) {

@@ -15,3 +15,3 @@ {

],
"version": "4.0.0",
"version": "4.0.1",
"license": "MIT",

@@ -23,4 +23,3 @@ "main": "lib/dateformat",

"@babel/preset-env": "^7.12.1",
"mocha": "^8.2.1",
"underscore": "1.7.0"
"mocha": "^8.2.1"
},

@@ -27,0 +26,0 @@ "engines": {

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc