Scenario: Time tracker to get working hours.. daily,monthly,yearly with unique jobID and specific user.
/*
* Descripition: Schema for the Time Tracker
*
*/
Schema: TimeTracker
{
Memo: "Test Memo",
DateNow: 12345,
WorkedHours: 5,
JobID: 12345,
StartTime: 12345,
EndTime:12345,
UserId:12345,
TotalHours: 5
screenshots: ""
}
/*
* Description: Output current working hours (day).
* Solution: Find the JobID and UserID then add all TotalHours Provided the Current Date.
*/
GetToday();
/*
* Description: Output Weekly consumed hours (Week).
* Solution: Find the JobID and UserID, then add all TotalHours From the Starting Date upto EndDate (Week)
*/
GetWeekly();
/*
* Description: Output Monthly consumed hours (month).
* Solution: Find the JobID and UserID, then add all TotalHours From the Starting Date upto EndDate (Month)
*/
GetMonthly();
// Javascript Sample Algorithms:
/*
* Getting current date
*/
var CurrentDate = Date.now();
/*
* Getting total hours
*/
var hours = Math.abs(1438669482758 - 1438669509312) / 36e5;
/*
* Timestamp to human readble format
* timestamp = 1382086394000;
*/
function TimestampToHuman(timestamp){
d = new Date(timestamp);
return d;
};