filipelou Posted June 12, 2008 at 06:29 PM Report Share #190925 Posted June 12, 2008 at 06:29 PM Olá eu tenho este código javascript para determinar se uma determinada data é menor que a actual mas ao que parecemesmo sendo igual diz que é menor: var dataStr=document.getElementById('dataId').value; var hoje= new Date();"); var data=new Date(dataStr.substr(6,4),dataStr.substr(3,2)-1,dataStr.substr(0,2),hoje.getHours(),hoje.getMinutes(),hoje.getSeconds()); if (data<hoje) {alert('data inferior à actual!!'}"); Link to comment Share on other sites More sharing options...
cyclop Posted June 13, 2008 at 01:51 AM Report Share #191026 Posted June 13, 2008 at 01:51 AM if (data==hoje) { alert('data igual'); } else if (data<hoje) { alert('data inferior à actual!!'); } else if (data>hoje) { alert('data superior à actual!!'); } epah... com coisas do genero new Date();"); !!'}"); entre outros... funcionar já é uma sorte! "Quando eu for grande quero ser como o Celso" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now