mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-01-23 02:35:14 +00:00
Bug Fix: Fix bug for the frontend custom dummy epg examples where DST was calculated on todays date instead of date of the event.
This commit is contained in:
parent
12aae44672
commit
d15d8f6644
1 changed files with 5 additions and 5 deletions
|
|
@ -300,16 +300,16 @@ const DummyEPGForm = ({ epg, isOpen, onClose }) => {
|
|||
extractedDay >= 1 &&
|
||||
extractedDay <= 31
|
||||
) {
|
||||
baseDate = dayjs()
|
||||
.tz(sourceTimezone)
|
||||
.year(extractedYear)
|
||||
.month(extractedMonth - 1) // dayjs months are 0-indexed
|
||||
.date(extractedDay);
|
||||
// Create a specific date string and parse it in the source timezone
|
||||
// This ensures DST is calculated correctly for the target date
|
||||
const dateString = `${extractedYear}-${extractedMonth.toString().padStart(2, '0')}-${extractedDay.toString().padStart(2, '0')}`;
|
||||
baseDate = dayjs.tz(dateString, sourceTimezone);
|
||||
}
|
||||
}
|
||||
|
||||
if (outputTimezone && outputTimezone !== sourceTimezone) {
|
||||
// Create a date in the source timezone with extracted or current date
|
||||
// Set the time on the date, which will use the DST rules for that specific date
|
||||
const sourceDate = baseDate
|
||||
.set('hour', hour24)
|
||||
.set('minute', minute)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue