Merge branch 'master' into create-status-md

This commit is contained in:
Aleksandr Statciuk 2022-10-22 04:45:56 +03:00
commit e177f94146
2 changed files with 3 additions and 3 deletions

View file

@ -12,8 +12,8 @@ module.exports = {
delay: 5000,
site: 'programtv.onet.pl',
url: function ({ date, channel }) {
const currDate = dayjs.utc().startOf('d').add(1, 'm')
const day = currDate.diff(date, 'd')
const currDate = dayjs.utc().startOf('d')
const day = date.diff(currDate, 'd')
return `https://programtv.onet.pl/program-tv/${channel.site_id}?dzien=${day}`
},

View file

@ -24,7 +24,7 @@ it('can generate valid url', () => {
})
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(
'https://programtv.onet.pl/program-tv/13th-street-250?dzien=1'
)