mirror of
https://github.com/comatory/fb2iCal
synced 2025-06-05 22:09:25 +02:00
fix: use browser's timezone to reflect correct time and date
This commit is contained in:
@ -1,12 +1,16 @@
|
||||
const cheerio = require('cheerio')
|
||||
const dayjs = require('dayjs')
|
||||
const utc = require('dayjs/plugin/utc')
|
||||
|
||||
const { parseDates } = require('../parser-utils')
|
||||
|
||||
dayjs.extend(utc)
|
||||
|
||||
const parseEventData = (eventData) => {
|
||||
const startDate = eventData.startDate ?
|
||||
dayjs(eventData.startDate) :
|
||||
dayjs(new Date())
|
||||
const endDate = eventData.endDate && dayjs(eventData.endDate)
|
||||
dayjs.utc(new Date())
|
||||
const endDate = eventData.endDate && dayjs.utc(eventData.endDate)
|
||||
const { start, duration } = parseDates(startDate, endDate)
|
||||
const { location } = eventData || {}
|
||||
const { address } = location || {}
|
||||
|
Reference in New Issue
Block a user