Socket
Socket
Sign inDemoInstall

aio-date

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.2.0

36

index.js

@@ -277,2 +277,34 @@ function AIODate(){

getToday(calendarType,unit = 'day'){return $$.GetToday[calendarType](unit)},
getPassedTime:(time)=>{
time = new Date(time).getTime();
let now = new Date().getTime();
let dif = now - time;
if(dif <= 0){return {days:0,hours:0,minutes:0,seconds:0,tenthseconds:0}}
let days = Math.floor(dif / (24 * 60 * 60 * 1000));
dif -= days * (24 * 60 * 60 * 1000);
let hours = Math.floor(dif / (60 * 60 * 1000));
dif -= hours * (60 * 60 * 1000);
let minutes = Math.floor(dif / (60 * 1000));
dif -= minutes * (60 * 1000);
let seconds = Math.floor(dif / (1000));
dif -= seconds * (1000);
let tenthseconds = Math.floor(dif / (100));
return {days,hours,minutes,seconds,tenthseconds}
},
getRemainingTime:(time)=>{
time = new Date(time).getTime();
let now = new Date().getTime();
let dif = time - now;
if(dif <= 0){return {days:0,hours:0,minutes:0,seconds:0,tenthseconds:0}}
let days = Math.floor(dif / (24 * 60 * 60 * 1000));
dif -= days * (24 * 60 * 60 * 1000);
let hours = Math.floor(dif / (60 * 60 * 1000));
dif -= hours * (60 * 60 * 1000);
let minutes = Math.floor(dif / (60 * 1000));
dif -= minutes * (60 * 1000);
let seconds = Math.floor(dif / (1000));
dif -= seconds * (1000);
let tenthseconds = Math.floor(dif / (100));
return {days,hours,minutes,seconds,tenthseconds}
}
}

@@ -295,5 +327,7 @@ return {

isMatch:$$.isMatch,
getDatesBetween:$$.getDatesBetween
getDatesBetween:$$.getDatesBetween,
getPassedTime:$$.getPassedTime,
getRemainingTime:$$.getRemainingTime
}
}
export default AIODate

2

package.json
{
"name": "aio-date",
"version": "1.1.0",
"version": "1.2.0",
"description": "",

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

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