Fixes time zone issue

#1332
This commit is contained in:
Aleksandr Statciuk
2022-11-14 13:36:24 +03:00
parent 8fb83afef5
commit adb3af4940
2 changed files with 3 additions and 11 deletions

View File

@@ -79,16 +79,8 @@ async function loadProgramDetails(item) {
.catch(console.error) .catch(console.error)
} }
// function parseStart(item) {
// return dayjs.utc(item.StartTime, 'YYYY-MM-DDTHH:mm:ss')
// }
// function parseStop(item) {
// return dayjs.utc(item.EndTime, 'YYYY-MM-DDTHH:mm:ss')
// }
function parseTime(time) { function parseTime(time) {
return dayjs.tz(time, 'YYYY-MM-DDTHH:mm:ss', 'Africa/Johannesburg') return dayjs.utc(time, 'YYYY-MM-DDTHH:mm:ss')
} }
function parseItems(content, channel) { function parseItems(content, channel) {

View File

@@ -63,8 +63,8 @@ it('can parse response', done => {
expect(result).toMatchObject([ expect(result).toMatchObject([
{ {
start: '2022-03-10T22:10:00.000Z', start: '2022-03-11T00:10:00.000Z',
stop: '2022-03-10T22:50:00.000Z', stop: '2022-03-11T00:50:00.000Z',
title: 'Curb Your Enthusiasm' title: 'Curb Your Enthusiasm'
// description: // description:
// "'S11/E6 of 10 - Man Fights Tiny Woman'. A general entertainment channel showcasing the best international content, focusing on scripted drama, comedy and talk.", // "'S11/E6 of 10 - Man Fights Tiny Woman'. A general entertainment channel showcasing the best international content, focusing on scripted drama, comedy and talk.",