@icgio/icg-utils 1.9.59 → 1.9.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/utils.js +0 -37
  2. package/package.json +1 -1
package/lib/utils.js CHANGED
@@ -47,48 +47,11 @@ Number.prototype.toStringNoExponents = function () {
47
47
  return str + z
48
48
  }
49
49
 
50
- Date.prototype.addHours = function (h) {
51
- return new Date(this.getTime() + h * 60 * 60 * 1000)
52
- }
53
-
54
- Date.prototype.roundHours = function (m = 1) {
55
- let coeff = m * 60 * 60 * 1000
56
- return new Date(Math.round(this.getTime() / coeff) * coeff)
57
- }
58
-
59
- Date.prototype.ceilHours = function (m = 1) {
60
- let coeff = m * 60 * 60 * 1000
61
- return new Date(Math.ceil(this.getTime() / coeff) * coeff)
62
- }
63
-
64
50
  Date.prototype.floorHours = function (m = 1) {
65
51
  let coeff = m * 60 * 60 * 1000
66
52
  return new Date(Math.floor(this.getTime() / coeff) * coeff)
67
53
  }
68
54
 
69
- Date.prototype.addMinutes = function (m) {
70
- return new Date(this.getTime() + m * 60 * 1000)
71
- }
72
-
73
- Date.prototype.roundMinutes = function (m = 1) {
74
- let coeff = m * 60 * 1000
75
- return new Date(Math.round(this.getTime() / coeff) * coeff)
76
- }
77
-
78
- Date.prototype.ceilMinutes = function (m = 1) {
79
- let coeff = m * 60 * 1000
80
- return new Date(Math.ceil(this.getTime() / coeff) * coeff)
81
- }
82
-
83
- Date.prototype.floorMinutes = function (m = 1) {
84
- let coeff = m * 60 * 1000
85
- return new Date(Math.floor(this.getTime() / coeff) * coeff)
86
- }
87
-
88
- Date.prototype.addSeconds = function (s) {
89
- return new Date(this.getTime() + s * 1000)
90
- }
91
-
92
55
  String.prototype.replaceAt = function (index, replacement) {
93
56
  return this.substr(0, index) + replacement + this.substr(index + replacement.length)
94
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-utils",
3
- "version": "1.9.59",
3
+ "version": "1.9.60",
4
4
  "description": "Utils package.",
5
5
  "main": "index.js",
6
6
  "directories": {