Year filters and database constrance

Tickets: #118 and #114