reymesson1 / septimoejercicio

1 stars 0 forks source link

Birthday changes #65

Closed reymesson1 closed 5 years ago

reymesson1 commented 5 years ago

exports.getCustomerBirthDay = async(req,res)=>{

var today = moment(new Date()).format('YYYY-MM-DD');
var todayPlusSeven = moment(new Date()).add(7, 'days').format('YYYY-MM-DD');

console.log(today)
console.log(todayPlusSeven)

var customer = await Customer.find({"fechacumpleano":{$gte:today,$lt:todayPlusSeven}})

res.send(customer);

}

reymesson1 commented 5 years ago
  var today = moment(new Date()).week();      

  let filteredTable = this.state.customers.filter(
      (master) => moment(master.fechacumpleano).week() == today
  )
reymesson1 commented 5 years ago

newCustomer["fechacumpleano"] = "0001"+newCustomer.fechacumpleano.substring(4,10)