How to format a date
This Calculated Field expression turns a date into text in the pattern you choose. Replace fieldAliasGoesHere with the alias of your date Field.
Format a date
Uses Moment.js format(). The format string is built from tokens such as MM (two-digit month), DD (two-digit day), and YYYY (four-digit year). The Moment.js documentation lists the rest, including day and month names.
// Date: August 6, 2022
// Result: "08-06-2022"
var date = $record['fieldAliasGoesHere'];
var formattedDate = moment(date).format("MM-DD-YYYY");
formattedDate;
The result is text, not a date, so it sorts and filters as text. Keep the original date Field alongside it when you still need date behavior.