@qrvey/utils 1.10.0-13 → 1.10.0-14

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.
@@ -22,13 +22,13 @@ function numericOffsetToISO(offset, leadZeros = true) {
22
22
  newOffset = (0, ISOToNumericOffset_1.ISOToNumericOffset)(newOffset);
23
23
  }
24
24
  if (typeof newOffset !== "number" && (0, isNaNV2_1.isNaNV2)(newOffset))
25
- return leadZeros ? "+00:00" : "+0:0";
25
+ return leadZeros ? "+00:00" : "+0";
26
26
  if (typeof newOffset === "string" && !(0, isNaNV2_1.isNaNV2)(newOffset))
27
27
  newOffset = +newOffset;
28
28
  const sign = (0, getSign_1.getSign)(newOffset);
29
29
  newOffset = Math.abs(newOffset);
30
30
  const hours = (0, padLeadingZeros_1.padLeadingZeros)(Math.floor(newOffset / 60), leadZeroNumber);
31
- const minutes = (0, padLeadingZeros_1.padLeadingZeros)(newOffset % 60, leadZeroNumber);
31
+ const minutes = (0, padLeadingZeros_1.padLeadingZeros)(newOffset % 60, 2);
32
32
  return `${sign}${hours}:${minutes}`;
33
33
  }
34
34
  exports.numericOffsetToISO = numericOffsetToISO;
@@ -9,7 +9,7 @@ const numericOffsetToISO_1 = require("../adapters/numericOffsetToISO");
9
9
  */
10
10
  function getUTCFormatByOffset(timezone) {
11
11
  let newOffset = (0, numericOffsetToISO_1.numericOffsetToISO)(timezone === null || timezone === void 0 ? void 0 : timezone.offset, false);
12
- if (newOffset.search(":0") > -1) {
12
+ if (newOffset.search(":00") > -1) {
13
13
  newOffset = newOffset.slice(0, newOffset.indexOf(":"));
14
14
  }
15
15
  return `UTC${newOffset}`;
@@ -19,12 +19,12 @@ export function numericOffsetToISO(offset, leadZeros = true) {
19
19
  newOffset = ISOToNumericOffset(newOffset);
20
20
  }
21
21
  if (typeof newOffset !== "number" && isNaNV2(newOffset))
22
- return leadZeros ? "+00:00" : "+0:0";
22
+ return leadZeros ? "+00:00" : "+0";
23
23
  if (typeof newOffset === "string" && !isNaNV2(newOffset))
24
24
  newOffset = +newOffset;
25
25
  const sign = getSign(newOffset);
26
26
  newOffset = Math.abs(newOffset);
27
27
  const hours = padLeadingZeros(Math.floor(newOffset / 60), leadZeroNumber);
28
- const minutes = padLeadingZeros(newOffset % 60, leadZeroNumber);
28
+ const minutes = padLeadingZeros(newOffset % 60, 2);
29
29
  return `${sign}${hours}:${minutes}`;
30
30
  }
@@ -6,7 +6,7 @@ import { numericOffsetToISO } from "../adapters/numericOffsetToISO";
6
6
  */
7
7
  export function getUTCFormatByOffset(timezone) {
8
8
  let newOffset = numericOffsetToISO(timezone === null || timezone === void 0 ? void 0 : timezone.offset, false);
9
- if (newOffset.search(":0") > -1) {
9
+ if (newOffset.search(":00") > -1) {
10
10
  newOffset = newOffset.slice(0, newOffset.indexOf(":"));
11
11
  }
12
12
  return `UTC${newOffset}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrvey/utils",
3
- "version": "1.10.0-13",
3
+ "version": "1.10.0-14",
4
4
  "description": "Helper, Utils for all Qrvey Projects",
5
5
  "homepage": "https://bitbucket.org/qrvey/qrvey_utils/wiki/Home",
6
6
  "main": "dist/index.js",