javascript - Compare dates as strings in typescript -


i trying compare 2 dates strings in typescript. input have below :-

startwindow = '05/2014' endwindow = '05/2018' 

i need write function check if start window greater end window.

both inputs of string type.

thanks

you can convert date , compare them:

function convertdate(d)  {  	var parts = d.split('/');  	return new date(parts[1], parts[0]);  }    var start = convertdate('05/2014');  var end = convertdate('05/2018');      alert(start < end);


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -