Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user.getDays = function ( year,month, callback) {
- month = month;
- var from = year + "-" + month + "-1";
- var lastDay = new Date(year, month, 0);
- var to = year + "-" + month + "-" + lastDay.getDate();
- var query = { FromDate: from, ToDate: to };
- connection.getDays(query, function (data) {
- var tasks = [];
- data.Days.forEach(function (d) {
- if ((d.ScheduledWorkMinutes > 0 || d.ActualWorkMinutes > 0) && (new Date(d.Date).getTime() < (new Date()).getTime())) {
- console.log(d.ActualWorkMinutes - d.ScheduledWorkMinutes);
- tasks[+new Date(d.Date)] = d.ActualWorkMinutes - d.ScheduledWorkMinutes;
- /*sData.id = id;
- sData.start = new Date(d.Date);
- var end = new Date(d.Date);
- end.setMinutes(d.ActualWorkMinutes);
- sData.end = end;
- sData.title = "kirjaus";
- sData.workMinutes = d.ActualWorkMinutes;
- sData.scheduledWorkMinutes = d.ScheduledWorkMinutes;
- sDataAll.push(sData);
- id++;*/
- } else {
- }
- });
- callback(tasks);
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement