mirror of
https://github.com/Alvin-Zilverstand/nginx-proxy-manager.git
synced 2026-11-28 17:07:53 +01:00
Frontend
This commit is contained in:
1 parent
80d78cbf25
commit
b38b988da4
40 files changed
+1419
No files matched your search
@@ -0,0 +1,36 @@
|
||||
'use strict';
|
||||
|
||||
const numeral = require('numeral');
|
||||
const moment = require('moment');
|
||||
|
||||
module.exports = {
|
||||
|
||||
/**
|
||||
* @param {Integer} number
|
||||
* @returns {String}
|
||||
*/
|
||||
niceNumber: function (number) {
|
||||
return numeral(number).format('0,0');
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {String|Integer} date
|
||||
* @returns {String}
|
||||
*/
|
||||
shortTime: function (date) {
|
||||
let shorttime = '';
|
||||
|
||||
if (typeof date === 'number') {
|
||||
shorttime = moment.unix(date).format('H:mm A');
|
||||
} else {
|
||||
shorttime = moment(date).format('H:mm A');
|
||||
}
|
||||
|
||||
return shorttime;
|
||||
},
|
||||
|
||||
replaceSlackLinks: function (content) {
|
||||
return content.replace(/<(http[^|>]+)\|([^>]+)>/gi, '<a href="$1" target="_blank">$2</a>');
|
||||
}
|
||||
|
||||
};
|
||||
Reference in new issue
Block a user