help w/ javascriopt for dates

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
greedyisg00d
Forum Commoner
Posts: 42
Joined: Thu Feb 12, 2009 2:48 am

help w/ javascriopt for dates

Post 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!
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: help w/ javascriopt for dates

Post 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 ;)
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply