diff options
| author | JP Dillingham <jp@dillingham.me> | 2023-07-22 23:00:39 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2023-07-22 23:00:39 -0500 |
| commit | c30601e020a8de18078379fd70a12ae5798cae3e (patch) | |
| tree | 3d7446e836fd0ac43be2cefdd335aa10eb0cf5ae /src | |
| parent | 3f34c91e2a1e372d3a0ac92ffcf9de63b63cc4f3 (diff) | |
| download | slskd-c30601e020a8de18078379fd70a12ae5798cae3e.tar.gz | |
add formatDate
Diffstat (limited to 'src')
| -rw-r--r-- | src/web/src/lib/util.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/web/src/lib/util.js b/src/web/src/lib/util.js index 20653737..974915ed 100644 --- a/src/web/src/lib/util.js +++ b/src/web/src/lib/util.js @@ -21,6 +21,10 @@ export const formatBytes = (bytes, decimals = 2) => { return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]; }; +export const formatDate = (date) => { + return new Date(date).toLocaleString(); +}; + export const getFileName = (fullPath) => { return fullPath.split('\\').pop().split('/').pop(); }; |
