-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmock_data.html
More file actions
108 lines (104 loc) · 3.17 KB
/
Copy pathmock_data.html
File metadata and controls
108 lines (104 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!doctype html>
<html>
<head>
<title>Mock Data Generator</title>
</head>
<body>
<h1>Mock Time Entry Data Generator</h1>
<button onclick="generateMockData()">Generate Mock Data</button>
<button onclick="viewData()">View localStorage</button>
<button onclick="clearData()">Clear All Data</button>
<pre id="output"></pre>
<script>
function generateMockData() {
const mockData = {
"2025-12-09": [
{
id: 1733760000000,
startTime: "09:00",
endTime: "12:00",
client: "ACME",
ticket: "123",
description: "Fixed login bug",
disabled: false,
},
{
id: 1733760000001,
startTime: "13:00",
endTime: "17:00",
client: "ACME",
ticket: "124",
description: "Implemented dark mode",
disabled: false,
},
],
"2025-12-10": [
{
id: 1733846400000,
startTime: "09:00",
endTime: "11:30",
client: "BETA",
ticket: "456",
description: "Code review; refactored authentication module",
disabled: false,
},
{
id: 1733846400001,
startTime: "11:30",
endTime: "12:30",
client: "BETA",
ticket: "457",
description: "Fixed deployment pipeline",
disabled: true,
},
{
id: 1733846400002,
startTime: "13:30",
endTime: "16:00",
client: "GAMMA",
ticket: "789",
description: "Database optimization",
disabled: false,
},
],
"2025-12-11": [
{
id: 1733932800000,
startTime: "09:00",
endTime: "10:30",
client: "ACME",
ticket: "125",
description: "Sprint planning meeting",
disabled: false,
},
{
id: 1733932800001,
startTime: "10:30",
endTime: "12:00",
client: "ACME",
ticket: "126",
description: "API endpoint development",
disabled: false,
},
],
};
localStorage.setItem("timeEntries", JSON.stringify(mockData));
document.getElementById("output").textContent =
"Mock data generated!\n\n" + JSON.stringify(mockData, null, 2);
}
function viewData() {
const data = localStorage.getItem("timeEntries");
if (data) {
document.getElementById("output").textContent =
"Current localStorage data:\n\n" + JSON.stringify(JSON.parse(data), null, 2);
} else {
document.getElementById("output").textContent = "No data in localStorage";
}
}
function clearData() {
localStorage.clear();
document.getElementById("output").textContent = "All localStorage cleared!";
}
</script>
</body>
</html>