mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-12-21 03:20:27 +00:00
Initial commit
This commit is contained in:
32
manager/src/frontend/js/lib/helpers.js
Normal file
32
manager/src/frontend/js/lib/helpers.js
Normal file
@@ -0,0 +1,32 @@
|
||||
'use strict';
|
||||
|
||||
import numeral from 'numeral';
|
||||
import moment from 'moment';
|
||||
|
||||
module.exports = {
|
||||
|
||||
/**
|
||||
* @param {Integer} number
|
||||
* @returns {String}
|
||||
*/
|
||||
niceNumber: function (number) {
|
||||
return numeral(number).format('0,0');
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {String} 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;
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user