jquery - Error in firefox with dates -


can me why script fails in firefox, works in other browsers?

i have function date before today, run something. return values:

seldate : mon dec 01 2014 00:00:00 gmt+0100 (cet) today: tue dec 02 2014 09:15:06 gmt+0100 (cet) 

works fine in browsers, not in firefox.

var dayid = $(this).attr('id'); var seldate = new date(dayid + "dec 2014"); var today = new date();  if ((seldate < today) || (seldate == today)) { //yes seldate before today. }else{ //no } 

i think problem there no space between date part , month

var seldate = new date(dayid + " dec 2014"); 

also there problem value today, have time part also.

var today = new date(); today.sethours(0,0,0,0) 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -