Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.

Commit

Permalink
#30 Calculando o total de horas na api
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriela Barrozo Guedes <gabrielabguedes@gmail.com>
  • Loading branch information
gabibguedes committed May 12, 2018
1 parent 1dafa99 commit 6830e7b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Schedule/Client/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ module.exports = function api(options){
var sector = msg.args.body.sector
var employee = msg.args.body.employee
var specialty = msg.args.body.specialty
var amount_of_hours = msg.args.body.amount_of_hours
var id = msg.args.query.id

// The diference between times is given in milliseconds. We are expecting hours,
//so wu divide by 3600000.0 that is the number of milliseconds in 1 hour
var amount_of_hours = (Date.parse(end_time) - Date.parse(start_time))/3600000.0

if(Date.parse(start_time) > Date.parse(end_time)){
this.act('role:schedule,cmd:create',{
}, respond(null, {success:false, message: 'Horários de Inicio e Fim estão em comflito'}))
Expand Down

0 comments on commit 6830e7b

Please sign in to comment.