How to set conditions with date picker widget?