inungh Posted September 11, 2013 Share Posted September 11, 2013 I need to assign a date time value from url, if is is null or does not exist then I want to assign current date, if the value exists then I need assign the value from url. I use the following code and try to use MyDate.tostring().length ==0), but it seems that Javascript does not recognize the equation, Any information is great appreciated, Regards, Inungh if (MyDate.tostring() === "") { MyDate = new Date(); }; if (MyTime.tostring() === "" ) { MyTime = new Date(); }; Link to comment Share on other sites More sharing options...
thescientist Posted September 11, 2013 Share Posted September 11, 2013 you'll have to provide a lot more information than that. Where do all those variables come from? Are you checking for errors in the console? What debugging are you doing to confirm the values of these variables? Link to comment Share on other sites More sharing options...
Ingolme Posted September 11, 2013 Share Posted September 11, 2013 To start off, toString() has an uppercase "S" Understanding where the data is coming from is important to solve your problem as well. 1 Link to comment Share on other sites More sharing options...
inungh Posted September 13, 2013 Author Share Posted September 13, 2013 Thanks for the information and help, Yes, it works after I changed s from lower case to upper case, Thanks again for helping, regards, Iccsi, 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