Skip to content

Conversation

@ctcpip
Copy link
Contributor

@ctcpip ctcpip commented Aug 4, 2025

this PR does the following:

  • switches to Temporal from luxon
    • currently polyfilled, but Temporal should be shipping imminently
    • this is written adding Temporal to the Global namespace such that when Temporal is available, only a couple lines need to be removed, and all the Temporal code can remain unchanged
  • updates node CI versions
  • adds error handling around the hackmd notes creation
  • adds tests to ensure DST is properly accounted for
  • adds support for timezone information in schedules, enforcing that either a timezone or UTC (Z) is specified

resolves #212

Copy link
Contributor

@blakeembrey blakeembrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more a migration to Temporal and doesn't fix DST right now.

Copy link
Member

@wesleytodd wesleytodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will let @blakeembrey and @ctcpip sort out the timezone discussion before making sure I fully review the tests, but the rest looks good with just minor nit/questions.

@ctcpip
Copy link
Contributor Author

ctcpip commented Aug 4, 2025

this PR pulls in Blake's changes from #225, and modified to use Temporal. also adds more test cases

const hasOffset = /[+-]\d{2}:?\d{2}/.test(startStr)
const hasTimezone = /\[[^\]]+\]/.test(startStr)
const hasUTC = /Z$/.test(startStr)
let instant, timezone
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let instant, timezone
let instant
let timezone

Sorry for the nit pick, but not only did I think the linter would have complained on this, I will personally. I have two unreasonable opinions as far as formatting goes:

  1. single variable declarations only: Except when de-structuring, this pattern ends with sloppy code and bad diffs later for zero benefit.
  2. Always use {} and return in arrow functions: similarly ends with hard to read sloppy code and bad diffs for no benefit.

Terseness when typing is never more important than the time spent later reading the code. I usually wouldn't make these types of comments as they are silly and nitpicking, but I know you and I have some fun discussions when it comes to silly pedantic opinions like this lol, so figured I would. Not blocking, to be clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

single variable declarations only

for assignment, yes 100% agree. but if no assignment, then it doesn't matter

Always use {} and return in arrow functions

I tend to agree, but when it's really straightforward, e.g. the .sort(), it's fine to omit

return next
}

const getNextScheduledMeeting = module.exports.getNextScheduledMeeting = function (schedules = [], now = Temporal.Now.instant()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Temporal.Now.instant() include a timezone? I was just wondering since I don't know Temporal well yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UTC

> Temporal.Now.instant()
Temporal.Instant 2025-08-07T15:00:02.637Z

wesleytodd added a commit that referenced this pull request Aug 7, 2025
@wesleytodd wesleytodd merged commit 2b34e8b into pkgjs:main Aug 7, 2025
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

Successfully merging this pull request may close these issues.

Local times may appear incorrectly in automated meeting issue

3 participants