2
0
mirror of https://github.com/Ride-The-Lightning/RTL synced 2024-10-31 09:20:27 +00:00
RTL/common.js
ShahanaFarooqui a1d9af33cc UX Bug Fixes
2018-11-24 15:11:23 -05:00

19 lines
659 B
JavaScript

var common = {};
common.lnd_server_url = 'https://localhost:8080/v1';
common.lnd_dir = '';
common.convertToBTC = (num) => {
return (num / 100000000).toFixed(6);
};
common.convertTimestampToDate = (num) => {
return new Date(+num*1000).toUTCString();
// datetoConvert = new Date(+num*1000);
// // (datetoConvert.getMonth() + 1) // Because in JS, months is an array and index starts with 0 (January gives 0)
// return (datetoConvert.getMonth() + 1) + '/' + datetoConvert.getDate() + '/' + datetoConvert.getFullYear() + ' ' +
// datetoConvert.getHours() + ':' + datetoConvert.getMinutes() + ':' + datetoConvert.getSeconds();
};
module.exports = common;