src/api/calendar/listFree.js
/*
 * For A Before 12pm
 * For E 12pm to 5pm
 * For P After 5pm
 */
For A Before 12pm
For E 12pm to 5pm
For P After 5pm
For A Before 12pm For E 12pm to 5pm For P After 5pm
function generateAMP(inputMoment) {
  const hour = inputMoment.hour();
  const minutes = inputMoment.minutes();
  const AMP = ['A', 'M', 'P'];
  switch (true) {
    case hour < 12 || (hour === 12 && minutes <= 0):
      return AMP[0];
    case hour >= 17:
      return AMP[2];
    default:
      return AMP[1];
  }
}
function generateAMP ( inputMoment ) { const hour = inputMoment . hour ( ) ; const minutes = inputMoment . minutes ( ) ; const AMP = [ 'A' , 'M' , 'P' ] ; switch ( true ) { case hour < 12 || ( hour === 12 && minutes <= 0 ) : return AMP [ 0 ] ; case hour >= 17 : return AMP [ 2 ] ; default : return AMP [ 1 ] ; } }
For A Before 12pm
 For E 12pm to 5pm
 For P After 5pm
For A Before 12pm For E 12pm to 5pm For P After 5pm