function sortByDateDescending(patients, field) {
  return patients.sort((a, b) => {
    return moment(b[`${field}`]).format('YYYYMMDD') - moment(a[`${field}`]).format('YYYYMMDD');
  });
}
/** sorts array of patients by specified date field youngest to oldest */
sorts array of patients by specified date field youngest to oldest
sorts array of patients by specified date field youngest to oldest
function sortByDateDescending(patients, field) {
  return patients.sort((a, b) => {
    return moment(b[`${field}`]).format('YYYYMMDD') - moment(a[`${field}`]).format('YYYYMMDD');
  });
}
function sortByDateDescending ( patients , field ) { return patients . sort ( ( a , b ) => { return moment ( b [ ` ${ field } ` ] ) . format ( 'YYYYMMDD' ) - moment ( a [ ` ${ field } ` ] ) . format ( 'YYYYMMDD' ) ; } ) ; }
sorts array of patients by specified date field youngest to oldest
sorts array of patients by specified date field youngest to oldest