Update elcinema.com.config.js

dateString needs to take into account single digit or double digit days to match format on website epg.
This commit is contained in:
yarafie 2022-01-11 19:59:32 +03:00 committed by GitHub
parent 406000ba48
commit 463a2e8428
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,7 +105,12 @@ function parseDescription(item) {
function parseItems(content, channel, date) {
const $ = cheerio.load(content)
const dateString = date.locale(channel.lang).format('dddd D MMMM')
// const dateString = date.locale(channel.lang).format('dddd D MMMM')
const dayNum = date.locale(channel.lang).format('D')
if ( dayNum.length == 1 ) dateString = date.locale(channel.lang).format('dddd D MMMM')
if ( dayNum.length == 2 ) dateString = date.locale(channel.lang).format('dddd D MMMM')
const list = $('.dates')
.filter((i, el) => {
return $(el).text().trim() === dateString