From 4d8ddd8cf6ed6561e846403be4074794e0bc9ebe Mon Sep 17 00:00:00 2001 From: Pablo Marco del Pont Date: Wed, 31 Oct 2018 17:29:45 -0300 Subject: [PATCH] =?UTF-8?q?Agregu=C3=A9=20directiva=20hasta=20hoy=20para?= =?UTF-8?q?=20limitar=20los=20inputs=20date.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.js | 4 ++++ src/js/hasta-hoy.js | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100644 src/js/hasta-hoy.js diff --git a/gulpfile.js b/gulpfile.js index 9e6e8fb..57c193c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -45,3 +45,7 @@ gulp.task('clean-post-install', function(){ return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js'], {read: false}) .pipe(clean()); }); + +gulp.task('watch', function(){ + return gulp.watch([paths.srcJS], ['uglify']); +}); diff --git a/src/js/hasta-hoy.js b/src/js/hasta-hoy.js new file mode 100644 index 0000000..dc81841 --- /dev/null +++ b/src/js/hasta-hoy.js @@ -0,0 +1,11 @@ +angular.module('focaDirectivas') + .directive('hastaHoy', function() { + return function(scope, element, attrs) { + var fechaActual = new Date(); + element.attr('max', + fechaActual.getFullYear() + '-' + + ('0' + (fechaActual.getMonth() + 1)).slice(-2) + '-' + + ('0' + fechaActual.getDate()).slice(-2) + ); + }; + }); -- 1.9.1