Commit 8b6bab1ec7f3ab751ecb6379a44968d67950e157
1 parent
8a9b7ef5c2
Exists in
master
and in
1 other branch
Agregado ver mas de un digito
Showing
3 changed files
with
11 additions
and
3 deletions
Show diff stats
src/app/components/comanda/comanda.component.html
... | ... | @@ -21,7 +21,7 @@ |
21 | 21 | 'bg-success swing-out-top-bck': comanda.estado === 3 |
22 | 22 | }"> |
23 | 23 | <div class="card-body p-2"> |
24 | - <p class="h1 card-title text-center mb-1">{{comanda.id.toString().slice(comanda.id.toString().length - 2)}} | |
24 | + <p class="h1 card-title text-center mb-1">{{rellenar(comanda.id.toString().slice(comanda.id.toString().length - 3), 3)}} | |
25 | 25 | </p> |
26 | 26 | <!-- TODO: Implementar moment --> |
27 | 27 | <p class="card-title text-center mb-1">{{comanda.fechafinelaboracion | date: 'dd-MM-yyyy HH:mm' : '+0000'}} |
src/app/components/comanda/comanda.component.ts
... | ... | @@ -66,4 +66,12 @@ export class ComandaComponent implements OnInit { |
66 | 66 | }, e => console.error(e)) |
67 | 67 | } |
68 | 68 | |
69 | + rellenar(relleno, longitud) { | |
70 | + relleno = '' + relleno; | |
71 | + while (relleno.length < longitud) { | |
72 | + relleno = '0' + relleno; | |
73 | + } | |
74 | + return relleno; | |
75 | + } | |
76 | + | |
69 | 77 | } |
src/app/components/pedidos-salientes/pedidos-salientes.component.html
... | ... | @@ -17,7 +17,7 @@ |
17 | 17 | class="col-12 p-2"> |
18 | 18 | <div class="border rounded shadow h-big"> |
19 | 19 | <div class="font-weight-bold m-0 h-100"> |
20 | - {{rellenar(pedidosRecientes[0].id.toString().slice(pedidosRecientes[0].id.toString().length - 2), 2)}} | |
20 | + {{rellenar(pedidosRecientes[0].id.toString().slice(pedidosRecientes[0].id.toString().length - 3), 3)}} | |
21 | 21 | </div> |
22 | 22 | </div> |
23 | 23 | </div> |
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 | [hidden]="i == 0 || i > 8" |
28 | 28 | class="col-3 p-2"> |
29 | 29 | <p class="font-weight-bold display-1 m-0 py-1 border rounded shadow"> |
30 | - {{rellenar(pedido.id.toString().slice(pedido.id.toString().length - 2), 2)}} | |
30 | + {{rellenar(pedido.id.toString().slice(pedido.id.toString().length - 2), 3)}} | |
31 | 31 | </p> |
32 | 32 | </div> |
33 | 33 |