From 94602696811d8b6a9ddc14571f2972ba28ce8b72 Mon Sep 17 00:00:00 2001 From: Luigi Date: Wed, 27 Mar 2019 15:39:59 -0300 Subject: [PATCH] =?UTF-8?q?Setear=20fecha=20del=20d=C3=ADa=20en=20la=20cab?= =?UTF-8?q?ecera?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/controller.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/js/controller.js b/src/js/controller.js index eca19b8..21c5cfd 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -65,11 +65,11 @@ angular.module('focaCrearHojaRuta') .controller('hojaRutaCtrl', console.info(err); } ); - + setearFecha(new Date()); $scope.inicial = angular.copy($scope.hojaRuta); } - $scope.$watch('hojaRuta', function(newValue, oldValue) { + $scope.$watch('hojaRuta', function(newValue) { focaBotoneraLateralService.setPausarData({ label: 'hojaRuta', val: newValue @@ -332,6 +332,15 @@ angular.module('focaCrearHojaRuta') .controller('hojaRutaCtrl', }); }; + function setearFecha(fecha) { + $timeout(function() { + $scope.$broadcast('addCabecera', { + label: 'Fecha de entrega: ', + valor: fecha.toLocaleDateString() + }); + }); + } + $scope.seleccionarDatosExtra = function() { var datosHojaRuta = $scope.hojaRuta.datosExtra; var modalInstance = $uibModal.open( @@ -367,7 +376,7 @@ angular.module('focaCrearHojaRuta') .controller('hojaRutaCtrl', }); }); }; - + $scope.verProductosRemito = function(idRemito) { var parametrosModal = { titulo: 'Articulos remito', -- 1.9.1