Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Native timezone support for recurring events #646

Open
naringst opened this issue Jan 24, 2025 · 1 comment
Open

Enhancement: Native timezone support for recurring events #646

naringst opened this issue Jan 24, 2025 · 1 comment

Comments

@naringst
Copy link

I'm currently implementing recurring events with RRule and need to handle timezone-specific repetitions. Currently, when setting a recurring event for 11:32 AM KST with tzid: 'Asia/Seoul', RRule doesn't automatically generate recurrences in Korean local time. Instead, I have to manually adjust the times by calculating UTC offsets.

Current workaround:

// Creating RRule with local time
const koreanEvent = new RRule({
 dtstart: datetime(
   localDate.getFullYear(),
   localDate.getMonth() + 1,
   localDate.getDate(), 
   11, // 11:32 KST
   32,
 ),
 tzid: 'Asia/Seoul',
 ...options
});

// Processing results
const dates = koreanEvent.all().map(utcDate => {
 return moment.tz(utcDate, 'Asia/Seoul')
   .subtract(utcOffset, 'hours')
   .toDate();
});

Feature request: Could RRule natively handle timezone-aware recurrences? For example, if I set:

new RRule({
  dtstart: someDateTime,
  tzid: 'Asia/Seoul',
  ...otherOptions
})

It would be helpful if RRule could directly return dates in the specified timezone without manual offset calculations.
Please let me know if I'm misunderstanding any part of RRule's timezone functionality. Thank you for considering this request!

@naringst naringst changed the title [TimeZone] Enhancement Request: Native timezone support for recurring events Enhancement: Native timezone support for recurring events Jan 24, 2025
@joao-moonward
Copy link

joao-moonward commented Feb 10, 2025

I also need this feature; I can try to spend some time on it.
This is where I reckon we can start the implementation.

if (keys[i] === 'tzid') continue

I wish the maintainer were active in this project, but if I create a PR, it will never get approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants