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) + ); + }; + });