Question: I have this domain class:

```
class activity {

    String name
    Date startDate
    Date endDate

    static constraints = {

    }
}

```

What i want to do is:

a) apply constrains to the dates, for example minimum date and maximum date

b) in my project i need to have an Array of dates and add as many endDates as i want. is it possible to do so? and how

Answer: 
> 
> a) apply constrains to the dates, for example minimum date and maximum date
> 
> 
> 

Here's an example of a minimum and maximum constraint applied to the `startDate` field

```
class activity {

    String name
    Date startDate
    Date endDate

    static constraints = {

        // date must be between today and today + 7 days
        startDate(min: new Date(), max: newDate() + 7)
    }
}

```
A good reading of the Grails docs would answer a lot of the questions you've been asking here.

a) [Adding Custom Validation to a Field](http://grails.org/doc/latest/ref/Constraints/validator.html)

b) If I understand you correctly, what you might want to do is create another class called something like ActivityEndDate and then build your domain like this:

```
class Activity {

   // regular properties

   static hasMany = [endDates:ActivityEndDate]   

}

```

Again, the [docs](http://grails.org/doc/latest/ref/Domain%20Classes/hasMany.html) are helpful here.