Refactored Date picker sample