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

Types are not compatible with Luxon 3.3 not in strict mode #485

Closed
zackdotcomputer opened this issue Apr 26, 2023 · 3 comments
Closed

Types are not compatible with Luxon 3.3 not in strict mode #485

zackdotcomputer opened this issue Apr 26, 2023 · 3 comments

Comments

@zackdotcomputer
Copy link

Essentially a reopen of #482 because that got closed without maintainer response or resolution.

The current ICalLuxonDateTimeStub is not compatible with [email protected]'s DateTime object if the system is not overridden to be in "strict mode". This is generally an issue with how Luxon has chosen to implement this new feature, but for the purposes of the ical-generator it feels like the system should accept non-strict DateTime objects.

The issue shows up with:

cal.createEvent({
      // These two values throw an error if using non-strict Luxon DateTime
      start,
      end,
      // Rest of args...
});

The specific error is:

Type 'DateTime' is not assignable to type 'ICalDateTimeValue | { (): ICalDateTimeValue | null; (start: ICalDateTimeValue): ICalEvent; } | null | undefined'.
  Type 'DateTime' is not assignable to type 'ICalLuxonDateTimeStub'.
    The types returned by 'toJSON()' are incompatible between these types.
      Type 'string | null' is not assignable to type 'string'.
        Type 'null' is not assignable to type 'string'.ts(2322)
@sebbo2002
Copy link
Owner

Thanks for the ticket, completely missed this at #482. I probably won't get to it until next week, thanks for your understanding.

@sebbo2002 sebbo2002 self-assigned this Apr 29, 2023
@sebbo2002 sebbo2002 added the bug label Apr 29, 2023
@sebbo2002 sebbo2002 mentioned this issue May 2, 2023
github-actions bot pushed a commit that referenced this issue May 2, 2023
# [4.1.0-develop.3](v4.1.0-develop.2...v4.1.0-develop.3) (2023-05-02)

### Bug Fixes

* Allow `null` return value for Luxon 3.3's DateTime.toJSON() ([bee19a8](bee19a8)), closes [#482](#482) [#485](#485)
@sebbo2002
Copy link
Owner

🎉 This issue has been resolved in version 4.1.0-develop.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this issue May 4, 2023
# [4.1.0](v4.0.0...v4.1.0) (2023-05-04)

### Bug Fixes

* Allow `null` return value for Luxon 3.3's DateTime.toJSON() ([bee19a8](bee19a8)), closes [#482](#482) [#485](#485)
* revent changes to package.json version ([916e460](916e460))
* revert package-lock.json ([a8d8f2d](a8d8f2d))

### Features

* Support trigger related behavior ([54743df](54743df))
@sebbo2002
Copy link
Owner

🎉 This issue has been resolved in version 4.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

2 participants