I have two string dates in the format of m/d/yyyy. For example, “11/1/2012”, “1/2/2013”. I am writing a function in JavaScript to compare two string dates. The signature of my function is
bool isLater(string1, string2),
if the date passed by string1 is later than the date passed by string2, it will return true, otherwise false.
So, isLater(“1/2/2013”, “11/1/2012”) should return true. How do I write a JavaScript function for this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…