@trackunit/date-and-time-utils 0.0.39-alpha-2936c016d71.0 → 0.0.41
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.
- package/index.cjs.js +9 -4
- package/index.esm.js +9 -2
- package/package.json +4 -3
package/index.cjs.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
require('@formatjs/intl-durationformat/polyfill');
|
|
6
4
|
var intlEnumerator = require('@formatjs/intl-enumerator');
|
|
7
5
|
var polyfill = require('@js-temporal/polyfill');
|
|
@@ -1129,9 +1127,16 @@ const calculateTime = (number, unit) => {
|
|
|
1129
1127
|
case "days":
|
|
1130
1128
|
return convertToDays(number);
|
|
1131
1129
|
case "hours":
|
|
1132
|
-
return
|
|
1130
|
+
return {
|
|
1131
|
+
days: 0,
|
|
1132
|
+
...convertToHours(number),
|
|
1133
|
+
};
|
|
1133
1134
|
case "minutes":
|
|
1134
|
-
return
|
|
1135
|
+
return {
|
|
1136
|
+
days: 0,
|
|
1137
|
+
hours: 0,
|
|
1138
|
+
...convertToMinutes(number),
|
|
1139
|
+
};
|
|
1135
1140
|
default:
|
|
1136
1141
|
return { days: 0, hours: 0, minutes: 0, seconds: 0 };
|
|
1137
1142
|
}
|
package/index.esm.js
CHANGED
|
@@ -1125,9 +1125,16 @@ const calculateTime = (number, unit) => {
|
|
|
1125
1125
|
case "days":
|
|
1126
1126
|
return convertToDays(number);
|
|
1127
1127
|
case "hours":
|
|
1128
|
-
return
|
|
1128
|
+
return {
|
|
1129
|
+
days: 0,
|
|
1130
|
+
...convertToHours(number),
|
|
1131
|
+
};
|
|
1129
1132
|
case "minutes":
|
|
1130
|
-
return
|
|
1133
|
+
return {
|
|
1134
|
+
days: 0,
|
|
1135
|
+
hours: 0,
|
|
1136
|
+
...convertToMinutes(number),
|
|
1137
|
+
};
|
|
1131
1138
|
default:
|
|
1132
1139
|
return { days: 0, hours: 0, minutes: 0, seconds: 0 };
|
|
1133
1140
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/date-and-time-utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.41",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -12,5 +12,6 @@
|
|
|
12
12
|
"@formatjs/intl-durationformat": "^0.2.2"
|
|
13
13
|
},
|
|
14
14
|
"module": "./index.esm.js",
|
|
15
|
-
"main": "./index.cjs.js"
|
|
16
|
-
|
|
15
|
+
"main": "./index.cjs.js",
|
|
16
|
+
"types": "./index.esm.d.ts"
|
|
17
|
+
}
|