nv-facutil-clock
Advanced tools
Comparing version 1.0.4 to 1.0.5
42
index.js
@@ -223,9 +223,20 @@ | ||
next_m(n=1) { | ||
//// | ||
let r = n%12; | ||
let q = (n-r) / 12; | ||
//// | ||
let d = this.dict(); | ||
if(d.m === 12) { | ||
d.y = d.y+1; | ||
d.m = 1; | ||
//// | ||
d.y = d.y + q; | ||
if(r===0) { | ||
} else { | ||
d.m = d.m+1; | ||
let m = d.m + r; | ||
if(m<=12) { | ||
d.m=m | ||
} else { | ||
d.m = m -12 | ||
d.y = d.y + 1 | ||
} | ||
} | ||
//// | ||
let s = _dict_to_str(d); | ||
@@ -237,9 +248,20 @@ let dt = new Date(s); | ||
prev_m(n=1) { | ||
//// | ||
let r = n%12; | ||
let q = (n-r) / 12; | ||
//// | ||
let d = this.dict(); | ||
if(d.m === 1) { | ||
d.y = d.y-1; | ||
d.m = 12; | ||
if(r===0) { | ||
} else { | ||
d.m = d.m-1; | ||
let m = d.m - r | ||
if(m>=1) { | ||
d.m = m | ||
} else { | ||
d.y = d.y -1; | ||
m = m +12 | ||
d.m = m | ||
} | ||
} | ||
d.y = d.y - q; | ||
//// | ||
let s = _dict_to_str(d); | ||
@@ -252,3 +274,3 @@ let dt = new Date(s); | ||
let d = this.dict(); | ||
d.y = d.y + 1; | ||
d.y = d.y + n; | ||
let s = _dict_to_str(d); | ||
@@ -261,3 +283,3 @@ let dt = new Date(s); | ||
let d = this.dict(); | ||
d.y = d.y - 1; | ||
d.y = d.y - n; | ||
let s = _dict_to_str(d); | ||
@@ -264,0 +286,0 @@ let dt = new Date(s); |
{ | ||
"name": "nv-facutil-clock", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "clock,date,generator,stream,cron", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18831
401