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.
@@ -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 dat = new Date(params.date);
3341
- let momentJs = moment(params.date).add(1, 'days');
3342
- console.log(momentJs);
3343
- if (this.validateSunday(momentJs.toDate())) {
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
- momentJs.format('dddd') + ', ' + momentJs.format('MMMM DD YYYY')
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
- const momentJs = moment(params.date).add(index - 1, 'M');
3364
- if (this.validateSunday(momentJs.toDate())) {
3365
- momentJs.add(1, 'days');
3366
- Swal.fire({
3367
- title: 'Querido asesor',
3368
- text: 'Hemos ajustado las fechas para que no se asignen en Domingos',
3369
- icon: 'info'
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
- momentJs.format('dddd') + ', ' + momentJs.format('MMMM DD YYYY'),
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' });