Commit 4d8ddd8cf6ed6561e846403be4074794e0bc9ebe
1 parent
74383aee25
Exists in
master
Agregué directiva hasta hoy para limitar los inputs date.
Showing
2 changed files
with
15 additions
and
0 deletions
Show diff stats
gulpfile.js
... | ... | @@ -45,3 +45,7 @@ gulp.task('clean-post-install', function(){ |
45 | 45 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js'], {read: false}) |
46 | 46 | .pipe(clean()); |
47 | 47 | }); |
48 | + | |
49 | +gulp.task('watch', function(){ | |
50 | + return gulp.watch([paths.srcJS], ['uglify']); | |
51 | +}); |
src/js/hasta-hoy.js
... | ... | @@ -0,0 +1,11 @@ |
1 | +angular.module('focaDirectivas') | |
2 | + .directive('hastaHoy', function() { | |
3 | + return function(scope, element, attrs) { | |
4 | + var fechaActual = new Date(); | |
5 | + element.attr('max', | |
6 | + fechaActual.getFullYear() + '-' + | |
7 | + ('0' + (fechaActual.getMonth() + 1)).slice(-2) + '-' + | |
8 | + ('0' + fechaActual.getDate()).slice(-2) | |
9 | + ); | |
10 | + }; | |
11 | + }); |