@integraciones_doc24/sdk 1.14.0 → 1.14.2

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.
@@ -16,7 +16,7 @@ const getScheduleMethods = (makeRequest) => {
16
16
  };
17
17
  const path = `/schedule/dates/${patientId}/${JSON.stringify(mappedFilter)}`;
18
18
  const response = await makeRequest('GET', path);
19
- return response.data.available_dates.map((o) => utils_1.parseDate(o.date));
19
+ return response.data.available_dates.map((o) => utils_1.parseDate(o.date, o.time_zone));
20
20
  };
21
21
  const getSchedule = async (patientId, specialtyId, filter = {}) => {
22
22
  var _a;
package/lib/utils.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const parseDate: (str: string) => Date;
2
- export declare const parseDateTime: (str: string, timeZone?: string) => Date;
1
+ export declare const parseDate: (str: string, timeZone?: string | null | undefined) => Date;
2
+ export declare const parseDateTime: (str: string, timeZone?: string | null | undefined) => Date;
package/lib/utils.js CHANGED
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseDateTime = exports.parseDate = void 0;
4
4
  const date_fns_1 = require("date-fns");
5
5
  // import {Doc24} from '.';
6
- const parseDate = (str) => exports.parseDateTime(`${str} 00:00:00`);
6
+ const defaultTimeZone = '-06';
7
+ const parseDate = (str, timeZone) => exports.parseDateTime(`${str} 00:00:00`, timeZone);
7
8
  exports.parseDate = parseDate;
8
- const parseDateTime = (str, timeZone = '-03') => date_fns_1.parse(`${str} ${timeZone}`, 'yyyy-MM-dd HH:mm:ss X', new Date());
9
+ const parseDateTime = (str, timeZone) => date_fns_1.parse(`${str} ${timeZone !== null && timeZone !== void 0 ? timeZone : defaultTimeZone}`, 'yyyy-MM-dd HH:mm:ss X', new Date());
9
10
  exports.parseDateTime = parseDateTime;
10
11
  // export const getIdetificationTypeId = (type: Doc24.IdentificationType) => {
11
12
  // if (type === 'ndi') return 6;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integraciones_doc24/sdk",
3
- "version": "1.14.0",
3
+ "version": "1.14.2",
4
4
  "publishConfig": {
5
5
  "tag": "latest"
6
6
  },