test(frontend): use absolute path for src imports (#9761)

* test(frontend): use absolute path for src imports

* Upgrade prettier, fix eslint
This commit is contained in:
Jesse Yang
2020-05-07 14:18:10 -07:00
committed by GitHub
parent 6237cea952
commit 13c5b133a9
220 changed files with 827 additions and 1730 deletions

View File

@@ -18,36 +18,25 @@
*/
import moment from 'moment';
export const fDuration = function(t1, t2, format = 'HH:mm:ss.SS') {
export const fDuration = function (t1, t2, format = 'HH:mm:ss.SS') {
const diffSec = t2 - t1;
const duration = moment(new Date(diffSec));
return duration.utc().format(format);
};
export const now = function() {
export const now = function () {
// seconds from EPOCH as a float
return moment()
.utc()
.valueOf();
return moment().utc().valueOf();
};
export const epochTimeXHoursAgo = function(h) {
return moment()
.subtract(h, 'hours')
.utc()
.valueOf();
export const epochTimeXHoursAgo = function (h) {
return moment().subtract(h, 'hours').utc().valueOf();
};
export const epochTimeXDaysAgo = function(d) {
return moment()
.subtract(d, 'days')
.utc()
.valueOf();
export const epochTimeXDaysAgo = function (d) {
return moment().subtract(d, 'days').utc().valueOf();
};
export const epochTimeXYearsAgo = function(y) {
return moment()
.subtract(y, 'years')
.utc()
.valueOf();
export const epochTimeXYearsAgo = function (y) {
return moment().subtract(y, 'years').utc().valueOf();
};