|
|
@@ -428,19 +428,22 @@ export class MESMHSFORMDAYSComponent implements OnInit {
|
|
|
|
|
|
changeNewDate(event: MatDatepickerInputEvent<Date>) {
|
|
|
if (event.value !== null) {
|
|
|
-
|
|
|
- let fechaInicio2 = new Date(this.dateFormat(this.data.item.FECHAFINAL));
|
|
|
- fechaInicio2 = new Date(fechaInicio2.getFullYear(), fechaInicio2.getMonth() + 1, fechaInicio2.getDate() + 2);
|
|
|
- let str_fecha_inicio = `${fechaInicio2.getDate()}-${fechaInicio2.getMonth()}-${fechaInicio2.getFullYear()}`;
|
|
|
+ let fechafinal = this.data.item.FECHAFINAL.split("-");
|
|
|
+ let fechaInicio2 = new Date(fechafinal[2], fechafinal[1] - 1, fechafinal[0]);
|
|
|
+ //fechaInicio2 = new Date(fechaInicio2.getFullYear(), fechaInicio2.getMonth(), fechaInicio2.getDate());
|
|
|
+ fechaInicio2.setDate(fechaInicio2.getDate() + 1);
|
|
|
+ let str_fecha_inicio = `${fechaInicio2.getDate()}-${fechaInicio2.getMonth()}-${fechaInicio2.getFullYear()}`
|
|
|
+
|
|
|
+ console.log(str_fecha_inicio);
|
|
|
+ console.log( this.getDateWithString(str_fecha_inicio));
|
|
|
+ console.log(this.getDateWithString(this.dateFormatInvert(str_fecha_inicio)));
|
|
|
+
|
|
|
|
|
|
if (
|
|
|
- new Date(event.value).getTime() >
|
|
|
- this.getDateWithString(str_fecha_inicio).getTime()
|
|
|
+ new Date(event.value).getTime() >= fechaInicio2.getTime()
|
|
|
) {
|
|
|
this.formGroup.patchValue({
|
|
|
- fecha_inicio_2: this.getDateWithString(
|
|
|
- this.dateFormatInvert(str_fecha_inicio)
|
|
|
- ),
|
|
|
+ fecha_inicio_2: fechaInicio2,
|
|
|
});
|
|
|
this.calcular_dias();
|
|
|
} else {
|