@integraciones_doc24/sdk 1.13.3 → 1.14.1
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/lib/userSdk/schedule.js +1 -1
- package/lib/utils.d.ts +1 -1
- package/lib/utils.js +2 -2
- package/package.json +1 -1
package/lib/userSdk/schedule.js
CHANGED
|
@@ -34,7 +34,7 @@ const getScheduleMethods = (makeRequest) => {
|
|
|
34
34
|
const response = await makeRequest('GET', path);
|
|
35
35
|
return response.data.available_appointments.map((a) => ({
|
|
36
36
|
id: a.id,
|
|
37
|
-
date: utils_1.parseDateTime(`${a.date} ${a.hour}
|
|
37
|
+
date: utils_1.parseDateTime(`${a.date} ${a.hour}`, a.time_zone),
|
|
38
38
|
clinicId: a.clinic,
|
|
39
39
|
professional: {
|
|
40
40
|
id: a.professional_id,
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const parseDate: (str: string) => Date;
|
|
2
|
-
export declare const parseDateTime: (str: string) => Date;
|
|
2
|
+
export declare const parseDateTime: (str: string, timeZone?: string | null | undefined) => Date;
|
package/lib/utils.js
CHANGED
|
@@ -3,10 +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
|
|
6
|
+
const defaultTimeZone = '-03';
|
|
7
7
|
const parseDate = (str) => exports.parseDateTime(`${str} 00:00:00`);
|
|
8
8
|
exports.parseDate = parseDate;
|
|
9
|
-
const parseDateTime = (str) => 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());
|
|
10
10
|
exports.parseDateTime = parseDateTime;
|
|
11
11
|
// export const getIdetificationTypeId = (type: Doc24.IdentificationType) => {
|
|
12
12
|
// if (type === 'ndi') return 6;
|