I have an array in my grails class
class BootStrap {
def init = { servletContext ->
def myArray = ["Aug 2011","111.0"]
new IndexValue (indexDate: new Date (),value: 100).save(flush:true)
assert IndexValue.count()==1
}
def destroy = {
}
}
Now in my javascript i have this value
var endDate = month + ' ' + endDate.getFullYear();
I just need to check if this endDate is the same as the date in my array above, if this date is there, just give an alert date is present
Pass it as javascript variables, when you’re rendering gsp, like:
where
monthis your grails/gsp variable