Update meo.pt.config.js
Fixes wrong timeshift
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
const utc = require('dayjs/plugin/utc')
|
const utc = require('dayjs/plugin/utc')
|
||||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||||
|
const timezone = require('dayjs/plugin/timezone')
|
||||||
|
|
||||||
dayjs.extend(utc)
|
dayjs.extend(utc)
|
||||||
dayjs.extend(customParseFormat)
|
dayjs.extend(customParseFormat)
|
||||||
|
dayjs.extend(timezone)
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
lang: 'pt',
|
lang: 'pt',
|
||||||
@@ -37,8 +39,10 @@ module.exports = {
|
|||||||
|
|
||||||
items.forEach(item => {
|
items.forEach(item => {
|
||||||
const title = item.name
|
const title = item.name
|
||||||
const start = dayjs.utc(`${item.date}/${item.timeIni}`, 'D-M-YYYY/HH:mm')
|
const localStart = dayjs.utc(`${item.date}/${item.timeIni}`, 'D-M-YYYY/HH:mm')
|
||||||
const stop = dayjs.utc(`${item.date}/${item.timeEnd}`, 'D-M-YYYY/HH:mm')
|
const start = dayjs.tz(localStart.toString(), 'Europe/Lisbon').toString()
|
||||||
|
const localStop = dayjs.utc(`${item.date}/${item.timeEnd}`, 'D-M-YYYY/HH:mm')
|
||||||
|
const stop = dayjs.tz(localStop.toString(), 'Europe/Lisbon').toString()
|
||||||
|
|
||||||
if (title && start && stop) {
|
if (title && start && stop) {
|
||||||
programs.push({
|
programs.push({
|
||||||
|
|||||||
Reference in New Issue
Block a user