How do I check to see if a field is date / datetime in Journey JS. I found a solution but curious if there is a better solution.
assuming I have a model called opportunity
var testField = "action_date";
var logValue;
var theField = view.opportunity.type.attributes[testField];
var fieldIsDay = theField.type.isDay;
if (fieldIsDay) {
logValue = getDateFormat(view.opportunity[testField]);
} else {
logValue = view.opportunity[testField].toString();
}