php - Javascript display based on Date -
I have a page which is already calling in a SQL database, and I'm based on a condition One of the entries I want to display to div. I can not find enough to do this for me, and I am struggling to find the right answers. To display me with javascript, I want a Div called
I & lt ;? Can display DB entry with Php echo $ data ["expired"]; ? & Gt; But I want to do something like this ....
& lt; Script type = "text / javascript" & gt; $ Function () {var subvalue; Yield = $ data ["end"]; If (..........) {$ ('# end date'). Show (); } And {$ ('# end date'). Hide (); }}}; & Lt; / Script & gt; But if I can not work a little bit. I want to be it if the date is a month away from "date" in "date" ["expired"] ... what am I missing? demo: / code > Is a date string; $ data ["expires"]
var expDate = new date (& lt ;? php dumb "$ data ['expiring']" ;? gt; & gt;); Var now = new date (); Var oneMonthFromNow = New date (now.Guaffular), now.GetMonth () + 1, now.GetDate ()); If (expDate & lt; = oneMonthFromNow) {$ ('# end date') Show (); } And {$ ('# end date'). Hide (); }
Comments
Post a Comment