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

Add Angular 18 support #199

Merged
merged 6 commits into from
Jun 28, 2024
Merged

Conversation

NetWin
Copy link

@NetWin NetWin commented Jun 5, 2024

Changes

  • Breaking change: Updated Angular and all other dependencies to their latest version
  • Breaking change: Updated peer dependencies to require Angular 18
  • Breaking change: Updated .browserslistrc to use the same supported browsers as Angular does
    (i just created a new ng18 app and copied the .browserslistrc file)
  • Updated demo application
    • some style adjustments
    • additional "inline" picker demo
    • replaced sass with scss

NetWin added 2 commits June 5, 2024 12:11
BREAKING CHANGE: Clients need to use Angular 18 to consume the latest version of this library.
Additionally, the browser support was updated to match the browsers that are supported by angular itself and
the demo application was updated to include a second demo for the date-time inline component.
@NetWin
Copy link
Author

NetWin commented Jun 10, 2024

@danielmoncada would you mind checking this out please? :)

@andreialecu
Copy link

Based on the activity in this repository it may seem like the original maintainer moved on from this project.

@NetWin - I see that you're quite active, so perhaps you can consider maintaining your fork, and we move over there. Just a thought.

@NetWin
Copy link
Author

NetWin commented Jun 25, 2024

Yeah i was thinking about this aswell. I even published a version under my npm scope already.

⚠️ But i did not test it yet ⚠️

@andreialecu
Copy link

I saw it and tried it.

I ran into #197 and #194 when using standalone components, particularly because it couldn't inject the DateAdapter.

I was able to work around it by adding OwlNativeDateTimeModule as an import to one of the remaining top level @NgModules in the app. Would be good to make this work with standalone components directly though, I'm not sure what needs to be done.

@NetWin
Copy link
Author

NetWin commented Jun 25, 2024

That's great! Okay i will take a look later and check what needs to be done to convert the library to standalone / make it work in an angular app that uses standalone components. I'll post here when i have an update. 👍

@NetWin
Copy link
Author

NetWin commented Jun 27, 2024

Yeah i was thinking about this aswell. I even published a version under my npm scope already.

⚠️ But i did not test it yet ⚠️

Edit: We now tested it and it works fine in 4 different Angular applications for us at work.

So if anyone needs it, feel free to use: https://www.npmjs.com/package/@netwin/angular-datetime-picker

If you encounter any problems, feel free to create an issue here: https://github.com/NetWin/date-time-picker

Regarding the issues pointed out above. We imported both the OwlDateTimeModule and the OwlNativeDateTimeModule into the standalone component that uses the date picker. And it works flawlessly.

I think the reason for these issues is that the Date picker does not work with JS Dates out of the Box. It's implemented in a generic way where you import the components via the OwlDateTimeModule and the DateTimeAdapter via the OwlNativeDateTimeModule. If the latter is missing, there is no way for the components to parse your provided dates, throwing an error in the process.

I'm currently working on a full upgrade of this library. (Strictmode, standalone, signals, improved documentation etc.) but this will take some time as i have to get familiar with the codebase first.

@NetWin NetWin mentioned this pull request Jun 27, 2024
@danielmoncada
Copy link
Owner

I'm still here. I will merge this and publish.

I apologize for the absence, been pretty busy at work.

@danielmoncada
Copy link
Owner

danielmoncada commented Jun 28, 2024

published, thank you @NetWin for the PR

@danielmoncada danielmoncada merged commit 21b26a8 into danielmoncada:master Jun 28, 2024
1 check passed
@NetWin NetWin deleted the feature/ng-18 branch June 28, 2024 04:34
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.

3 participants