mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Merge pull request #787 from mcastellaneta/mcastellaneta-raiplay.it-time
Change raiplay.it time to UTC
This commit is contained in:
commit
1604021e12
2 changed files with 10 additions and 6 deletions
|
@ -1,9 +1,11 @@
|
||||||
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')
|
||||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||||
|
|
||||||
dayjs.extend(utc)
|
dayjs.extend(utc)
|
||||||
dayjs.extend(customParseFormat)
|
dayjs.extend(customParseFormat)
|
||||||
|
dayjs.extend(timezone)
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
site: 'raiplay.it',
|
site: 'raiplay.it',
|
||||||
|
@ -17,8 +19,7 @@ module.exports = {
|
||||||
|
|
||||||
data.events.forEach(item => {
|
data.events.forEach(item => {
|
||||||
if (item.name && item.hour && item.duration_in_minutes) {
|
if (item.name && item.hour && item.duration_in_minutes) {
|
||||||
const startDate = dayjs
|
const startDate = dayjs.tz(item.hour, 'HH:mm','Europe/Rome')
|
||||||
.utc(item.hour, 'HH:mm')
|
|
||||||
.set('D', date.get('D'))
|
.set('D', date.get('D'))
|
||||||
.set('M', date.get('M'))
|
.set('M', date.get('M'))
|
||||||
.set('y', date.get('y'))
|
.set('y', date.get('y'))
|
||||||
|
@ -46,8 +47,11 @@ module.exports = {
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseIcon(item) {
|
function parseIcon(item) {
|
||||||
return cover = item.image ? `https://www.raiplay.it${item.image}` : null
|
let cover = null;
|
||||||
|
if(item.image){
|
||||||
|
cover = `https://www.raiplay.it${item.image}`
|
||||||
|
}
|
||||||
|
return cover
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseURL(item) {
|
function parseURL(item) {
|
||||||
|
|
|
@ -27,8 +27,8 @@ it('can parse response', () => {
|
||||||
|
|
||||||
expect(result).toMatchObject([
|
expect(result).toMatchObject([
|
||||||
{
|
{
|
||||||
start: '2022-05-03T19:40:00.000Z',
|
start: '2022-05-03T17:40:00.000Z',
|
||||||
stop: '2022-05-03T20:30:00.000Z',
|
stop: '2022-05-03T18:30:00.000Z',
|
||||||
title: 'The Good Doctor S3E5 - La prima volta',
|
title: 'The Good Doctor S3E5 - La prima volta',
|
||||||
description:
|
description:
|
||||||
"Shaun affronta il suo primo intervento. Il caso si rivela complicato e, nonostante Shaun abbia un'idea geniale, sarà Andrews a portare a termine l'operazione.",
|
"Shaun affronta il suo primo intervento. Il caso si rivela complicato e, nonostante Shaun abbia un'idea geniale, sarà Andrews a portare a termine l'operazione.",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue