Fix invalid date

This commit is contained in:
FARID 2021-08-17 22:41:52 +07:00 committed by GitHub
parent b4f863c9f0
commit 1cda2233a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@ const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
const timezone = require('dayjs/plugin/timezone')
require('dayjs/locale/id')
dayjs.extend(utc)
dayjs.extend(customParseFormat)
@ -23,8 +24,8 @@ module.exports = {
const scheduleDate = dom.window.document.querySelector(
'div.b-livestreaming-daily-schedule__date-label'
).textContent
const currdate = dayjs(scheduleDate)
).textContent.split(',')
const currdate = dayjs(scheduleDate[1], 'DD MMMM YYYY', 'id')
const list = dom.window.document.querySelector(
`#schedule-content-${currdate.format(
'YYYYMMDD'