iptdevs-design-system 2.7.60 → 2.7.61
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/esm2020/lib/cod/logic/calculate-quotes.service.mjs +20 -28
- package/fesm2015/iptdevs-design-system.mjs +19 -26
- package/fesm2015/iptdevs-design-system.mjs.map +1 -1
- package/fesm2020/iptdevs-design-system.mjs +19 -26
- package/fesm2020/iptdevs-design-system.mjs.map +1 -1
- package/lib/cod/logic/calculate-quotes.service.d.ts +0 -1
- package/package.json +1 -1
|
@@ -3333,14 +3333,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
3333
3333
|
class CalculateQuotesService {
|
|
3334
3334
|
constructor() { }
|
|
3335
3335
|
calculateQuotes(params) {
|
|
3336
|
-
console.log(params);
|
|
3337
3336
|
console.log(params.date);
|
|
3337
|
+
console.log("--------");
|
|
3338
3338
|
let dataFinancing = [];
|
|
3339
3339
|
let index = 1; // Indicador de cant. de cuotas
|
|
3340
|
-
let
|
|
3341
|
-
|
|
3342
|
-
console.log(
|
|
3343
|
-
|
|
3340
|
+
let dateJs = new Date(params.date);
|
|
3341
|
+
console.log("------ JS --------");
|
|
3342
|
+
console.log(dateJs);
|
|
3343
|
+
console.log(" ---- +1 ----");
|
|
3344
|
+
dateJs.setDate(dateJs.getDate() + 1);
|
|
3345
|
+
console.log(dateJs);
|
|
3346
|
+
if (dateJs.getDay() === 0) {
|
|
3344
3347
|
Swal.fire({
|
|
3345
3348
|
title: 'Fecha inválida',
|
|
3346
3349
|
text: 'Debe seleccionar un día de la semana diferente al domingo',
|
|
@@ -3355,43 +3358,33 @@ class CalculateQuotesService {
|
|
|
3355
3358
|
currency: 'USD',
|
|
3356
3359
|
minimumFractionDigits: 0
|
|
3357
3360
|
}).format(Math.round(parseFloat(params.quotaValues.toString()))),
|
|
3358
|
-
|
|
3361
|
+
dateJs.getFullYear() + " " + dateJs.getMonth() + "" + dateJs.getDate()
|
|
3359
3362
|
];
|
|
3360
3363
|
dataFinancing.push(quota);
|
|
3361
3364
|
while (index < params.quotaTimes) {
|
|
3362
3365
|
index = index + 1;
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
});
|
|
3366
|
+
dateJs.setDate(dateJs.getMonth() + 1);
|
|
3367
|
+
while (dateJs.getDay() === 0) {
|
|
3368
|
+
console.log("------ JS --------");
|
|
3369
|
+
console.log(dateJs);
|
|
3370
|
+
console.log(" ---- +1 ----");
|
|
3371
|
+
dateJs.setDate(dateJs.getDate() + 1);
|
|
3372
|
+
console.log(dateJs);
|
|
3371
3373
|
}
|
|
3372
3374
|
let row = [
|
|
3373
3375
|
index,
|
|
3374
3376
|
Intl.NumberFormat('en-US', {
|
|
3375
3377
|
style: 'currency',
|
|
3376
3378
|
currency: 'USD',
|
|
3377
|
-
minimumFractionDigits: 0
|
|
3378
|
-
}).format(Math.round(params.quotaValues)),
|
|
3379
|
-
|
|
3379
|
+
minimumFractionDigits: 0
|
|
3380
|
+
}).format(Math.round(parseFloat(params.quotaValues.toString()))),
|
|
3381
|
+
dateJs.getFullYear() + " " + dateJs.getMonth() + "" + dateJs.getDate()
|
|
3380
3382
|
];
|
|
3381
3383
|
dataFinancing.push(row);
|
|
3382
3384
|
}
|
|
3383
3385
|
}
|
|
3384
3386
|
return dataFinancing;
|
|
3385
3387
|
}
|
|
3386
|
-
validateSunday(date) {
|
|
3387
|
-
const momentJs = moment(date);
|
|
3388
|
-
if (momentJs.isoWeekday() === 7) {
|
|
3389
|
-
return true;
|
|
3390
|
-
}
|
|
3391
|
-
else {
|
|
3392
|
-
return false;
|
|
3393
|
-
}
|
|
3394
|
-
}
|
|
3395
3388
|
}
|
|
3396
3389
|
CalculateQuotesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CalculateQuotesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3397
3390
|
CalculateQuotesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: CalculateQuotesService, providedIn: 'root' });
|