Update programacion-tv.elpais.com.config.js
Fixes wrong timeshift
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
const dayjs = require('dayjs')
|
||||
const utc = require('dayjs/plugin/utc')
|
||||
const timezone = require('dayjs/plugin/timezone')
|
||||
|
||||
dayjs.extend(utc)
|
||||
dayjs.extend(timezone)
|
||||
|
||||
module.exports = {
|
||||
lang: 'es',
|
||||
@@ -21,8 +23,10 @@ module.exports = {
|
||||
if (!channelData) return programs
|
||||
channelData.programas.forEach(item => {
|
||||
if (item.title && item.iniDate && item.endDate) {
|
||||
const start = dayjs.utc(item.iniDate).toString()
|
||||
const stop = dayjs.utc(item.endDate).toString()
|
||||
const startLocal = dayjs.utc(item.iniDate).toString()
|
||||
const start = dayjs.tz(startLocal.toString(), 'Europe/Madrid')
|
||||
const stopLocal = dayjs.utc(item.endDate).toString()
|
||||
const stop = dayjs.tz(stopLocal.toString(), 'Europe/Madrid')
|
||||
programs.push({
|
||||
title: item.title,
|
||||
description: item.description,
|
||||
|
||||
Reference in New Issue
Block a user