Commit 91f01402f9fc484fc80e497ec9d1e9611598d992
Exists in
develop
Merge branch 'develop' into 'develop'
Develop See merge request !143
Showing
5 changed files
Show diff stats
src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.ts
... | ... | @@ -3,6 +3,7 @@ import { ICategoria } from 'src/app/interfaces/ICategoria'; |
3 | 3 | import { InactiveScreenService } from 'src/app/services/inactive-screen/inactive-screen.service'; |
4 | 4 | import { CategoriaService } from 'src/app/services/categoria/categoria.service'; |
5 | 5 | import { APP_SETTINGS } from 'src/etc/AppSettings'; |
6 | +import { DateExtension } from 'src/app/utils/dateExtension'; | |
6 | 7 | |
7 | 8 | @Component({ |
8 | 9 | selector: 'app-filtro-categorias', |
... | ... | @@ -87,12 +88,8 @@ export class FiltroCategoriasComponent implements OnInit { |
87 | 88 | }, 500); |
88 | 89 | } |
89 | 90 | |
90 | - validarFecha(fechaInicioString: string, fechaFinString: string) { | |
91 | - const fechaInicio = new Date(fechaInicioString); | |
92 | - const fechaFin = new Date(fechaFinString); | |
93 | - const fechaAux = Date.now(); | |
94 | - const fechaHoy = new Date(fechaAux); | |
95 | - return (fechaHoy >= fechaInicio && fechaHoy <= fechaFin) ? true : false; | |
91 | + validarFecha(fechaInicio: string, fechaFin: string) { | |
92 | + return DateExtension.ValidateDateRange(fechaInicio, fechaFin); | |
96 | 93 | } |
97 | 94 | |
98 | 95 | mediaPantalla() { |
src/app/modules/seleccion-articulos/seleccion-articulos.component.html
... | ... | @@ -40,6 +40,7 @@ |
40 | 40 | <!-- ARTICULO --> |
41 | 41 | <div |
42 | 42 | *ngFor="let articulo of auxArticulos | slice:0:showQuantity;" |
43 | + [hidden]="validarFecha(articulo.FECHA_VIGENCIA_DESDE, articulo.FECHA_VIGENCIA_HASTA)" | |
43 | 44 | class="col px-2 my-1 my-md-3 h-auto"> |
44 | 45 | <div |
45 | 46 | class="swing-in-top-fwd btn-effect card h-auto" |
src/app/modules/seleccion-articulos/seleccion-articulos.component.ts
... | ... | @@ -13,6 +13,7 @@ import { FiltroCategoriasComponent } from './filtro-categorias/filtro-categorias |
13 | 13 | import * as _ from 'lodash'; |
14 | 14 | import { ANIMATIONS } from 'src/app/utils/animations'; |
15 | 15 | import { NoStockComponent } from './no-stock/no-stock.component'; |
16 | +import { DateExtension } from 'src/app/utils/dateExtension'; | |
16 | 17 | |
17 | 18 | @Component({ |
18 | 19 | selector: 'app-seleccion-articulos', |
... | ... | @@ -188,6 +189,11 @@ export class SeleccionArticulosComponent implements OnInit, AfterViewInit, OnDes |
188 | 189 | this.showQuantity += 100; |
189 | 190 | } |
190 | 191 | |
192 | + | |
193 | + validarFecha(fechaInicio: string, fechaFin: string) { | |
194 | + return DateExtension.ValidateDateRange(fechaInicio, fechaFin); | |
195 | + } | |
196 | + | |
191 | 197 | @HostListener('scroll', ['$event']) |
192 | 198 | scrollEvent(event: Event) { |
193 | 199 | clearTimeout(this.inactiveScreen.timerReposo); |
src/app/services/articulo/articulo.service.ts
... | ... | @@ -87,7 +87,8 @@ export class ArticuloService { |
87 | 87 | pedidoAnombreDe: dataPago.pedidoAnombreDe, |
88 | 88 | numeroPlanilla: APP_SETTINGS.numeroPlanilla, |
89 | 89 | pedidoParaLlevar: localStorage.getItem('pedidoParaLlevar'), |
90 | - terminal: APP_SETTINGS.terminal | |
90 | + terminal: APP_SETTINGS.terminal, | |
91 | + contactLess: true, | |
91 | 92 | }) |
92 | 93 | .subscribe((data) => { |
93 | 94 | observer.next(data); |
src/app/utils/dateExtension.ts
... | ... | @@ -0,0 +1,10 @@ |
1 | +export class DateExtension { | |
2 | + | |
3 | + public static ValidateDateRange(dateStart: string, dateEnd: string) { | |
4 | + if (dateEnd === null) return false; | |
5 | + const today = new Date(Date.now()); | |
6 | + return (new Date(dateStart) <= today && today <= new Date(dateEnd)) | |
7 | + ? true : false; | |
8 | + } | |
9 | + | |
10 | +} |