@carlosdiazz/lottodiz-shared 2.3.7 → 2.3.9

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.
@@ -0,0 +1 @@
1
+ export declare function diffMinutesFromDates(baseDate: Date, timeString: string): number;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.diffMinutesFromDates = diffMinutesFromDates;
7
+ const dayjs_1 = __importDefault(require("dayjs"));
8
+ function diffMinutesFromDates(baseDate, timeString) {
9
+ // Tomamos el día REAL exacto sin que la zona cambie
10
+ const year = baseDate.getUTCFullYear();
11
+ const month = String(baseDate.getUTCMonth() + 1).padStart(2, "0");
12
+ const day = String(baseDate.getUTCDate()).padStart(2, "0");
13
+ // Construimos la fecha base REAL
14
+ const baseDateOnly = `${year}-${month}-${day}`;
15
+ // Crear date1 = fecha base + hora
16
+ const date1 = (0, dayjs_1.default)(`${baseDateOnly} ${timeString}`, "YYYY-MM-DD HH:mm:ss");
17
+ // Fecha actual local
18
+ const date2 = (0, dayjs_1.default)();
19
+ return date2.diff(date1, "minute");
20
+ }
@@ -4,6 +4,7 @@ export * from "./convert-time-zone";
4
4
  export * from "./convert-to-number-array";
5
5
  export * from "./create-interval-array";
6
6
  export * from "./deep-partial";
7
+ export * from "./diff-minutes-from-dates";
7
8
  export * from "./exect-function";
8
9
  export * from "./get-day-number-of-day";
9
10
  export * from "./get-delay-from-date-time";
@@ -20,6 +20,7 @@ __exportStar(require("./convert-time-zone"), exports);
20
20
  __exportStar(require("./convert-to-number-array"), exports);
21
21
  __exportStar(require("./create-interval-array"), exports);
22
22
  __exportStar(require("./deep-partial"), exports);
23
+ __exportStar(require("./diff-minutes-from-dates"), exports);
23
24
  __exportStar(require("./exect-function"), exports);
24
25
  __exportStar(require("./get-day-number-of-day"), exports);
25
26
  __exportStar(require("./get-delay-from-date-time"), exports);
@@ -36,6 +36,9 @@ const validateDate = (date_verify, arrs) => {
36
36
  // COSTA RICA JPS
37
37
  format_dates.push(dayjs_1.default.utc(date_verify).format("dddd, D [de] MMMM").toUpperCase());
38
38
  format_dates.push(dayjs_1.default.utc(date_verify).format("dddd, DD [de] MMMM").toUpperCase());
39
+ // YELU ECUDADOR
40
+ format_dates.push(dayjs_1.default.utc(date_verify).format("DD [de] MMMM YYYY - dddd").toUpperCase());
41
+ format_dates.push(dayjs_1.default.utc(date_verify).format("D [de] MMMM YYYY - dddd").toUpperCase());
39
42
  //! Ingles
40
43
  dayjs_1.default.locale("en");
41
44
  //Test
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carlosdiazz/lottodiz-shared",
3
- "version": "2.3.7",
3
+ "version": "2.3.9",
4
4
  "description": "Shared Dtos, models, constants and utils",
5
5
  "main": "dist/index.js",
6
6
  "private": false,