mirror of
https://github.com/iptv-org/epg
synced 2025-12-17 02:47:02 -05:00
test and timezone
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
|
const utc = require('dayjs/plugin/utc')
|
||||||
|
|
||||||
|
dayjs.extend(utc)
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
site: 'programetv.ro',
|
site: 'programetv.ro',
|
||||||
@@ -45,11 +48,11 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function parseStart(item) {
|
function parseStart(item) {
|
||||||
return dayjs.utc(item.start)
|
return dayjs(item.start).toJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseStop(item) {
|
function parseStop(item) {
|
||||||
return dayjs.utc(item.stop)
|
return dayjs(item.stop).toJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseContent(content) {
|
function parseContent(content) {
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ it('can parse response', () => {
|
|||||||
const result = parser({ date, channel, content })
|
const result = parser({ date, channel, content })
|
||||||
expect(result).toMatchObject([
|
expect(result).toMatchObject([
|
||||||
{
|
{
|
||||||
start: 'Sun, 07 Nov 2021 05:00:00 GMT',
|
start: '2021-11-07T05:00:00.000Z',
|
||||||
stop: 'Sun, 07 Nov 2021 07:59:59 GMT',
|
stop: '2021-11-07T07:59:59.000Z',
|
||||||
title: 'Ştirile Pro Tv',
|
title: 'Ştirile Pro Tv',
|
||||||
description: `În fiecare zi, cele mai importante evenimente, transmisiuni LIVE, analize, anchete şi reportaje sunt la Ştirile ProTV.`,
|
description: `În fiecare zi, cele mai importante evenimente, transmisiuni LIVE, analize, anchete şi reportaje sunt la Ştirile ProTV.`,
|
||||||
category: ['Ştiri'],
|
category: ['Ştiri'],
|
||||||
|
|||||||
Reference in New Issue
Block a user