-
Notifications
You must be signed in to change notification settings - Fork 177
Angular 18 #393
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
base: master
Are you sure you want to change the base?
Angular 18 #393
Conversation
One can only hope to get this merged, thanks @GNURub Edit: |
I published the branch: https://www.npmjs.com/settings/ngxmc/packages |
Hey @GNURub, I have been attempting to use your fork for Angular 18 and have been running into some issues with the exposed modules, is there an exposed module for NgxMatDatetimePickerModule? |
@scohen-trinity, standalone components:
|
@GNURub thank you for the clarification and I was able to get everything working with the standalone components with one issue with one of the ES Module files, I get this error message:
I don't think that I added any input to the package and this prevents the project from building, can you help me troubleshoot this? |
@scohen-trinity share the pice of code and ng version |
please do merge this branch, there only one library in our project which is waiting for the update to Angular 18. |
Hi @GNURub, i'm trying to give your solution a try but i found some issues: Issue 1
I figured out the problem, was this import: I did:
Changed to:
And it works Other working solution is avoid creating the constant and provide the value directly:
Issue 2The mat-calendar-body-label padding is broken: Issue 3The buttons to change the time are disabled when the date is not yet selected, but the color is wrong: Issue 4Changing month using arrows, this warning will appear (track is wrong) Thanks again for your work on this branch, i think we can maybe save the lib |
@GNURub I updated my comment pointing some issues i found while testing the branch, i hope it helps! |
Hi @GNURub , Github notified me that you did some work here. I tested everything again, only problem left is "Issue 3", the arrow buttons color when disabled is still black (instead of grey-disabled color) Thanks again for your work 👍 |
I found a very interesting alternative (M3). ng-matero |
@GNURub if this is approved and not merged is this github not maintained anymore ? should we use https://www.npmjs.com/package/@ngxmc/datetime-picker |
@h2qutc |
@GNURub could you update for Angular 19? |
Yeah. I am going to keep it |
can you estimate when you will support angular 19 material? |
It is very coupled with material, I have taken a look and in v19 they have deprecated many of the methods that this package uses... At the moment v19 is using angular v19 and v18 in material. |
I have tried to use https://www.npmjs.com/package/@ngxmc/color-picker/v/19.0.0: import { MAT_COLOR_FORMATS, NgxMatColorPickerModule, NGX_MAT_COLOR_FORMATS } from '@ngxmc/color-picker'; --> TS2724: '@ngxmc/color-picker' has no exported member named NgxMatColorPickerModule. Did you mean NgxMatColorPickerInput |
I would guess the component is now exported as standalone rather than through an NgModule. |
@GNURub but how to install it with material 18 and angular 19 ? With --force still getting: ./node_modules/@ngxmc/datetime-picker/fesm2022/ngxmc-datetime-picker.mjs:4307:34-49 - Error: export 'mixinErrorState' (imported as 'mixinErrorState') was not found in '@angular/material/core' ./node_modules/@ngxmc/datetime-picker/fesm2022/ngxmc-datetime-picker.mjs:5506:37-47 - Error: export 'mixinColor' (imported as 'mixinColor') was not found in '@angular/material/core' (possible exports: n '@angular/material/core' |
hi, i have the same issue than @serg-mois-capital . Material removes use of |
God bless you @GNURub |
@@ -147,7 +142,7 @@ export class NgxMatMomentAdapter extends NgxMatDateAdapter<Moment> { | |||
} | |||
|
|||
clone(date: Moment): Moment { | |||
return date.clone().locale(this.locale); | |||
return date.clone().locale(this.dateLocale); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why changed to dateLocale? It is initialized in constructor and its value can never be changed via setLocale() method. That means that there is no way how to reflect application locale changes in adapter... As you can see, this leads to two different locales handle by picker. (Days of week have 'cs' locale but month selector and display format is 'en').
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can change it via the 'MAT_DATE_LOCALE' token
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried but moment adapter does not reflect changes of MAT_DATE_LOCALE, it takes only provided value it in main.ts {provide: MAT_DATE_LOCALE, useValue: 'cs-CZ' }. But not dynamically from any other component. Native adapter works as expected because it sets locale based on MAT_DATE_LOCALE in constructor but then works only with "locale" variable. Moment adapter uses both "locale" and "dateLocale" and I think that there is a problem. Or please do you have any working example how to change it dynamically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to deprecate the custom providers of this library, to use the ones from material that already have time support. We will support the ones from material which are: material-date-fns-adapter, material-luxon-adapter and material-moment-adapter. I'm testing, please be patient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thank you :-) Using adapter from Material seems to me like the best option. I will wait for final version.
Migration to angular 18