-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #410 from wazuh/3.8-tooltips-typos
3.8 tooltips typos
- Loading branch information
Showing
6 changed files
with
130 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
SplunkAppForWazuh/appserver/static/js/services/date-diff/dateDiffService.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
define(['../module'], function (module) { | ||
'use strict' | ||
|
||
class DateDiffService { | ||
constructor() { | ||
this.start = null | ||
this.end = null | ||
} | ||
|
||
/** | ||
* Returns the difference between dates | ||
*/ | ||
getDateDiff(start, end) { | ||
this.start = new Date(start) | ||
this.end = new Date(end) | ||
const result = { | ||
duration: 'Unknown', | ||
inProgress: false, | ||
end: this.end || 'Unknown', | ||
start: this.start || 'Unknown' | ||
} | ||
if (this.end && this.start) { | ||
result.duration = (this.end - this.start) / 1000 / 60; | ||
result.duration = Math.round(result.duration * 100) / 100; | ||
if (result.duration <= 0) { | ||
result.inProgress = true; | ||
} | ||
} | ||
return result | ||
} | ||
} | ||
|
||
module.service('$dateDiffService', DateDiffService) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters