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

#expiryDate , if the end date column entry on the database is one month away.

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? $ data ["expires"]

demo:

/ code > Is a date string;

  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

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

class - Kivy: how to instantiate a dynamic classes in python -

java - Algorithm negotiation fail SSH in Jenkins -