/ Published in: JavaScript
Usage: worktime([startHours, startMinutes],[endHours, endMinutes]);
Expand |
Embed | Plain Text
var worktime = function(from, to) { var w = new Date( new Date(0,0,0,to[0]-1,to[1],0) - new Date(0,0,0,from[0],from[1],0) ); return w.getHours() + " hours and " + w.getMinutes() + " minutes"; }
You need to login to post a comment.
