Page 1 of 1

help w/ javascriopt for dates

Posted: Wed Jul 15, 2009 10:30 pm
by greedyisg00d
Hi I am currently working on some sort of scheduler for our school project. My current problem is I need a javascript that goes like this:

Date From: 07/18/2009
Date To: 07/06/2009

Thus this will show some popout error message saying "Date From must not be ahead than Date To".
I manage to accomplish this in php but for what I know php is server side therefore my teacher suggested that I used client side scripting for our error messages. Honestly I am not good when in comes to javascript programming

Thanks in advance!

Re: help w/ javascriopt for dates

Posted: Thu Jul 16, 2009 3:39 am
by VladSun
From http://www.w3schools.com/jsref/jsref_obj_date.asp
you need:
http://www.w3schools.com/jsref/jsref_parse.asp

... only :)

Edit:
Maybe spliting the date string and using http://www.w3schools.com/jsref/jsref_utc.asp wouild be better.
Make some tests ;)