<commit_before>// CONTROLLER USED TO HANDLE MEET INVITE FORM DATA
angular.module('MeetlyApp.form', [])

.controller('formController', function($scope, $location, validateFormFactory, httpRequestsFactory, storeData) {

  // SET VARIABLES
  $scope.formData = {};
  $scope.categoryData = [
    { name: 'Select Category' },
    { name: 'Active Life' },
    { name: 'Arts & Entertainment' },
    { name: 'Automotive' },
    { name: 'Beauty & Spas' },
    { name: 'Education' },
    { name: 'Event Planning & Services' },
    { name: 'Financial Services' },
    { name: 'Food' },
    { name: 'Health & Medical' },
    { name: 'Home Services' },
    { name: 'Hotels & Travel' },
    { name: 'Local Flavor' },
    { name: 'Local Services' },
    { name: 'Mass Media' },
    { name: 'Nightlife' },
    { name: 'Pets' },
    { name: 'Professional Services' },
    { name: 'Public Services & Government' },
    { name: 'Real Estate' },
    { name: 'Religious Organizations' },
    { name: 'Restaurants' },
    { name: 'Shopping' }
  ];

  $scope.disableName = 'Select Category'

  $scope.selectedCategory = $scope.categoryData[0];

  // GET EVENT DATE AND TIME ============================================================
  $scope.eventDateTime = {};

  $('#datetimepicker').datetimepicker({
    format: 'MM-DD-YYYY, hh:mm A'
  });

  $("#datetimepicker").on("dp.change", function (e) {
    var getDateTime = $('#eventDateTime').val();
    var fields = getDateTime.split(', ');
    console.log('====> ', fields)
    $scope.eventDateTime.f_date = fields[0];
    $scope.eventDateTime.f_time = fields[1];
    console.log('dateTime: ', $scope.eventDateTime)
  });

  // PULL FRIENDS LIST AND APPEND TO PAGE ===============================================
  httpRequestsFactory.friendsList()
  .then(function (friends) {
    $scope.friendsList = friends;
  })
  .catch(function (error) {
    console.error(error);
  });

  $scope.checkbox = function() {
    $scope.selectedFriendsList = [];
    angular.forEach($scope.friendsList, function(friend){
      if (!!friend.selected) $scope.selectedFriendsList.push({ name: friend.name, email: friend.email }) ;
    });
  }

  // HANDLE FORM SUBMISSION AND VALIDATE DATA =====================================================
  $scope.submitForm = function(formSubmissionObj) {
    $scope.postRequest = validateFormFactory.toValidate(formSubmissionObj);
    
    if ($scope.postRequest) {
      // DATA IS VALID AND CAN CALL YELP API POST REQUEST
      initMeetSearch();
    } else {
      // HANDLE VALIDATION ERROR
    };<commit_msg>Done: Able to get data for Date & Time and Friends name & email<commit_after>// CONTROLLER USED TO HANDLE MEET INVITE FORM DATA
angular.module('MeetlyApp.form', [])

.controller('formController', function($scope, $location, validateFormFactory, httpRequestsFactory, storeData) {

  // SET VARIABLES
  $scope.formData = {};
  $scope.categoryData = [
    { name: 'Select Category' },
    { name: 'Active Life' },
    { name: 'Arts & Entertainment' },
    { name: 'Automotive' },
    { name: 'Beauty & Spas' },
    { name: 'Education' },
    { name: 'Event Planning & Services' },
    { name: 'Financial Services' },
    { name: 'Food' },
    { name: 'Health & Medical' },
    { name: 'Home Services' },
    { name: 'Hotels & Travel' },
    { name: 'Local Flavor' },
    { name: 'Local Services' },
    { name: 'Mass Media' },
    { name: 'Nightlife' },
    { name: 'Pets' },
    { name: 'Professional Services' },
    { name: 'Public Services & Government' },
    { name: 'Real Estate' },
    { name: 'Religious Organizations' },
    { name: 'Restaurants' },
    { name: 'Shopping' }
  ];

  $scope.disableName = 'Select Category'

  $scope.selectedCategory = $scope.categoryData[0];

  // GET EVENT DATE AND TIME ============================================================
  $scope.eventDateTime = {};

  $('#datetimepicker').datetimepicker({
    format: 'MM-DD-YYYY, hh:mm A'
  });

  $("#datetimepicker").on("dp.change", function (e) {
    var getDateTime = $('#eventDateTime').val();
    var fields = getDateTime.split(', ');
    $scope.eventDateTime.f_date = fields[0];
    $scope.eventDateTime.f_time = fields[1];
  });

  // PULL FRIENDS LIST AND APPEND TO PAGE ===============================================
  httpRequestsFactory.friendsList()
  .then(function (friends) {
    $scope.friendsList = friends;
  })
  .catch(function (error) {
    console.error(error);
  });

  $scope.checkbox = function() {
    $scope.selectedFriendsList = [];
    angular.forEach($scope.friendsList, function(friend){
      if (!!friend.selected) $scope.selectedFriendsList.push({ name: friend.name, email: friend.email }) ;
    });
  }

  // HANDLE FORM SUBMISSION AND VALIDATE DATA =====================================================
  $scope.submitForm = function(formSubmissionObj) {
    $scope.postRequest = validateFormFactory.toValidate(formSubmissionObj);
    
    if ($scope.postRequest) {
      // DATA IS VALID AND CAN CALL YELP API POST REQUEST
      initMeetSearch();
    } else {
      // HANDLE VALIDATION ERROR
    };
{'fraction_non_alphanumeric': 0.2156053459119497, 'fraction_numerical': 0.0011792452830188679, 'mean_word_length': 3.507528786536758, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '237808', 'n_tokens_mistral': 1617, 'n_tokens_neox': 1548, 'n_words': 349}