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