Update utils.js

This commit is contained in:
Aleksandr Statciuk 2022-05-09 16:13:13 +03:00
parent 5643fca4c0
commit 1af271f80a
1 changed files with 4 additions and 4 deletions

View File

@ -149,10 +149,10 @@ utils.escapeString = function (string, defaultValue = '') {
.trim()
}
utils.convertToXMLTV = function ({ channels, programs }) {
let output = `<?xml version="1.0" encoding="UTF-8" ?><tv date="${dayjs
.utc()
.format('YYYYMMDD')}">\r\n`
utils.convertToXMLTV = function ({ channels, programs, date = dayjs.utc() }) {
let output = `<?xml version="1.0" encoding="UTF-8" ?><tv date="${dayjs(date).format(
'YYYYMMDD'
)}">\r\n`
for (let channel of channels) {
const id = utils.escapeString(channel['xmltv_id'])
const displayName = utils.escapeString(channel.name)