var db = require('./db.js');
var moment = require('moment');
var _ = require('lodash');

var get = function() {
  return db.get('reservations').value();
};

var make = function(id, arrivalDate, nights, guests) {
  if (guests > 5 || !arrivalDate || !nights || !guests) {
    return false;
  }
  let reservationDetails = {
    "id":           id,
    "arrivalDate":  arrivalDate,
    "nights":       nights,
    "guests":       guests,
    "status":       'Confirmed',
    "bookedOn":      moment().format('MMMM Do YYYY'),
    "price":        nights*_.random(200,249)
  };

  db.get('reservations')
    .push(reservationDetails)
    .value();

  return reservationDetails;
};

module.exports = {
  get: get,
  make: make
};

@@ -358,16 +358,23 @@
 Date%22:  
+moment(
 arrivalD
@@ -376,16 +376,40 @@
 ivalDate
+).format('MMMM Do YYYY')
 ,%0A    %22n
@@ -506,17 +506,16 @@
 okedOn%22:
- 
      mom

Format arrivalDate when creating reservation in db