Skip to content

Instantly share code, notes, and snippets.

@parwatcodes
Last active June 10, 2020 16:09
Show Gist options
  • Select an option

  • Save parwatcodes/4fab1580ea697762f780e178814ffbaa to your computer and use it in GitHub Desktop.

Select an option

Save parwatcodes/4fab1580ea697762f780e178814ffbaa to your computer and use it in GitHub Desktop.
// Array of timesheet for the selected week. from = "02-02-2020", to = "08-02-2020"
const timeSheetData = [
{
id: "P-011",
taskId: "T-011",
// more fields such as taskname, projectname and more
timeEntriesForWeek: {
"02-02-2020": 1,
"03-02-2020": 4,
"04-02-2020": null,
"05-02-2020": null,
"06-02-2020": 3,
"07-02-2020": 2,
"08-02-2020": 1
}
},
{
id: "P-011",
taskId: "T-0111",
timeEntriesForWeek: {
"02-02-2020": 1,
"03-02-2020": 4,
"04-02-2020": null,
"05-02-2020": null,
"06-02-2020": 3,
"07-02-2020": 2,
"08-02-2020": 1
}
},
{
id: "P-012",
taskId: "T-70",
timeEntriesForWeek: {
"02-02-2020": 1,
"03-02-2020": 4,
"04-02-2020": null,
"05-02-2020": null,
"06-02-2020": 3,
"07-02-2020": 2,
"08-02-2020": 1
}
},
];
// Grouped timesheet data (task) based upon project
[
{
"id": "P-011",
"isGrouped": true,
"tasks": [
{
"id": "P-011",
"taskId": "T-011",
"timeEntriesForWeek": {
"02-02-2020": 1,
"03-02-2020": 4,
"04-02-2020": null,
"05-02-2020": null,
"06-02-2020": 3,
"07-02-2020": 2,
"08-02-2020": 1
}
},
{
"id": "P-011",
"taskId": "T-0111",
"timeEntriesForWeek": {
"02-02-2020": 1,
"03-02-2020": 4,
"04-02-2020": null,
"05-02-2020": null,
"06-02-2020": 3,
"07-02-2020": 2,
"08-02-2020": 1
}
}
]
},
{
"id": "P-012",
"taskId": "T-70",
"timeEntriesForWeek": {
"02-02-2020": 1,
"03-02-2020": 4,
"04-02-2020": null,
"05-02-2020": null,
"06-02-2020": 3,
"07-02-2020": 2,
"08-02-2020": 1
}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment