I think that using .val() on a datepicker widget is generally not as good as using the native getDate method. It returns a date object which is what you wanted. https://api.jqueryui.com/datepicker/#method-getDate