Skip to content

Commit

Permalink
Cutting down ending time identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Kostiantyn Korniienko committed Dec 14, 2023
1 parent 6ca4805 commit c213d8d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
.DS_Store

npm-debug.log*

.idea/aws.xml
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tempo-extension",
"version": "1.1.9",
"version": "1.2.0",
"description": "Tempo extension",
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Tempo Extension",
"version": "1.1.9",
"version": "1.2.0",
"description": "Show notifications on Tempo SLA",
"icons": {
"16": "icons/icon_16.png",
Expand Down
8 changes: 5 additions & 3 deletions src/slaStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ const slaStorage = {
lastSla.m = Math.floor(((secDiff / 60) % 60));
lastSla.h = Math.floor(secDiff / 3600);
payload.createdAt = newDate;
if (lastSla.h > 0) {
payload.sla = `${lastSla.h}${lastSla.m}ₘ`;
if (lastSla.h > 9) {
payload.sla = `${lastSla.h}ₕ`;
} else if (lastSla.h > 0) {
payload.sla = `${lastSla.h}${lastSla.m}`;
} else if (lastSla.m > 9) {
payload.sla = `${lastSla.m}ₘ`;
} else if (lastSla.m > 0) {
payload.sla = `${lastSla.m}${lastSla.s}`;
payload.sla = `${lastSla.m}${lastSla.s}`;
} else {
payload.sla = `${lastSla.s}ₛ`;
}
Expand Down

0 comments on commit c213d8d

Please sign in to comment.