This is probably the easiest way:
new Date(<your-date-object>.toDateString());
Example: To get the Current Date without time component:
new Date(new Date().toDateString());
gives:
Thu Jul 11 2019 00:00:00 GMT-0400 (Eastern Daylight Time)
Note this works universally, because toDateString() produces date string with your browser’s localization (without the time component), and the new Date() uses the same localization to parse that date string.
You can extend the Date object as below, so and then use the dateOnly property:
Date.prototype.getDateWithoutTime = function () {
return new Date(this.toDateString());
}
Now <any-date-object>.getDateWithoutTime(); will output Date only