Store date when using datepicker