mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
Merge pull request #1200 from mgroma/master
Polish TV: fixed the day logic in url()
This commit is contained in:
commit
1388c9de3e
2 changed files with 3 additions and 3 deletions
|
@ -12,8 +12,8 @@ module.exports = {
|
||||||
delay: 5000,
|
delay: 5000,
|
||||||
site: 'programtv.onet.pl',
|
site: 'programtv.onet.pl',
|
||||||
url: function ({ date, channel }) {
|
url: function ({ date, channel }) {
|
||||||
const currDate = dayjs.utc().startOf('d').add(1, 'm')
|
const currDate = dayjs.utc().startOf('d')
|
||||||
const day = currDate.diff(date, 'd')
|
const day = date.diff(currDate, 'd')
|
||||||
|
|
||||||
return `https://programtv.onet.pl/program-tv/${channel.site_id}?dzien=${day}`
|
return `https://programtv.onet.pl/program-tv/${channel.site_id}?dzien=${day}`
|
||||||
},
|
},
|
||||||
|
|
|
@ -24,7 +24,7 @@ it('can generate valid url', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can generate valid url for next day', () => {
|
it('can generate valid url for next day', () => {
|
||||||
MockDate.set(dayjs.utc('2021-11-25', 'YYYY-MM-DD').startOf('d'))
|
MockDate.set(dayjs.utc('2021-11-23', 'YYYY-MM-DD').startOf('d'))
|
||||||
expect(url({ channel, date })).toBe(
|
expect(url({ channel, date })).toBe(
|
||||||
'https://programtv.onet.pl/program-tv/13th-street-250?dzien=1'
|
'https://programtv.onet.pl/program-tv/13th-street-250?dzien=1'
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue