JDRssDownloader/utils.js

23 lines
540 B
JavaScript
Raw Normal View History

2022-10-25 16:41:45 +01:00
const fs = require('fs');
config = JSON.parse(fs.readFileSync('config.json'))
var moment = require('moment');
function returnUpdatedDate(date, offset) {
var newDate = moment(date);
newDate.add(offset, 'm');
return new moment(newDate).format("ddd, LTS")
}
2022-10-25 16:41:45 +01:00
function nextRssRefresh() {
return returnUpdatedDate(global.rssRefreshTime, config.RSSFeedRefreshMins)
2022-10-25 16:41:45 +01:00
}
function nextLinkCheck() {
return returnUpdatedDate(global.linkCheckTime, config.JDPostLinksMins)
2022-10-25 16:41:45 +01:00
}
module.exports = {
nextRssRefresh, nextLinkCheck
2022-10-25 16:41:45 +01:00
}