From 463a2e842898227866e365f15b2e3194db1370b9 Mon Sep 17 00:00:00 2001 From: yarafie <88841013+yarafie@users.noreply.github.com> Date: Tue, 11 Jan 2022 19:59:32 +0300 Subject: [PATCH] Update elcinema.com.config.js dateString needs to take into account single digit or double digit days to match format on website epg. --- sites/elcinema.com/elcinema.com.config.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sites/elcinema.com/elcinema.com.config.js b/sites/elcinema.com/elcinema.com.config.js index efcfdc7c..1bad9068 100644 --- a/sites/elcinema.com/elcinema.com.config.js +++ b/sites/elcinema.com/elcinema.com.config.js @@ -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