SaturnTeam / saturn-datepicker

Angular Material Datepicker with range selection
MIT License
278 stars 110 forks source link

After updating project to Angular 10.1.0 #157

Open paco76 opened 3 years ago

paco76 commented 3 years ago

After updating my Angular project to the latest version 10.1.0 I get the following error..

Class 'SatDatepicker' incorrectly implements interface 'CanColor'. Property 'defaultColor' is missing in type 'SatDatepicker' but required in type 'CanColor'.

someone else ?

paco76 commented 3 years ago

Okay, as a temporary fix I added defaultColor: ThemePalette key value pair to the SatDatepicker class inside the app node_modules folder

Lesterw commented 3 years ago

Updated angular material from version 9 to version 10.2.0 and got the exact same error as mentioned by @paco76.

itstueben commented 3 years ago

Had the same issue after updating to angular 10.1.

joseluiz98 commented 3 years ago

Had the same bug, just added the missing property inside 'datepicker.d.ts'.

itstueben commented 3 years ago

I switched to default mat-datepicker. https://material.angular.io/components/datepicker/overview#date-range-input-forms-integration

meblum commented 3 years ago

I see the fix has been merged. Any would you please publish the update?

andriipaziuk commented 3 years ago

please publish the update

ahmedsamir6446 commented 3 years ago

Pls mention if this merge is published

EmanuelChaves commented 3 years ago

Same issue after updating, please merge the update.

ahmedsamir6446 commented 3 years ago

I would prefer using the angular material date range picker as @itstueben

cantelopejoe commented 3 years ago

I assume that this PR has not been merged?

sabrinaToulouse commented 3 years ago

Hi, any news here?

AlonsoK28 commented 3 years ago

Anybody knows when will be publish the fix update?

SaturnTeam commented 3 years ago

Anybody knows when will be publish the fix update?

When someone makes a pr with working building process. I can't find a time to compile an ng library for new angular verison

sabrinaToulouse commented 3 years ago

Hi @SaturnTeam,

Is this lib still maintained or should we move on the new material date range picker?

Thx

PhilipSh commented 3 years ago

the same issue after updating to angular 10.2

SaturnTeam commented 3 years ago

@sabrinaToulouse It's better to move to Angular Material

AlonsoK28 commented 3 years ago

Okay, as a temporary fix I added defaultColor: ThemePalette key value pair to the SatDatepicker class inside the app node_modules folder

Can you explain how to do this?

paco76 commented 3 years ago

@AlonsoK28 go here /node_modules/saturn-datepicker/datepicker.d.ts and find the following line of code and add the line defaultColor: ThemePalette

export declare class SatDatepicker<D> implements OnDestroy, CanColor {

...

 private _document;
/** Whenever datepicker is for selecting range of dates. */
defaultColor: ThemePalette // this line is added here to fix an issue after upgrading to angular 10 !!!

...

}`

save and ng serve your app good luck!

JamboBuenna commented 3 years ago

Bump on the when can this be merged in. This is a simple fix & the temporary fix is only going to resolve the issue for those who are checking in contents of node modules

morgangit commented 3 years ago

@AlonsoK28 go here /node_modules/saturn-datepicker/datepicker.d.ts and find the following line of code and add the line defaultColor: ThemePalette

export declare class SatDatepicker<D> implements OnDestroy, CanColor {

...

 private _document;
/** Whenever datepicker is for selecting range of dates. */
defaultColor: ThemePalette // this line is added here to fix an issue after upgrading to angular 10 !!!

...

}`

save and ng serve your app good luck!

@paco76 when I go to this file all I see is:

`/**

//# sourceMappingURL=saturn-datepicker.d.ts.map`

Any ideas? Can't get rid of this 'defaultColor' error...

paco76 commented 3 years ago

@AlonsoK28 it looks like you are on the wrong file. saturn-datepicker.d.ts.map make sure it does not end with .map the file name should be saturn-datepicker.d.ts

morgangit commented 3 years ago

@paco76 no I really am in saturn-datepicker.d.ts image

The contents of the .map file is:

{"version":3,"file":"saturn-datepicker.d.ts","sources":["saturn-datepicker.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA","sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\nexport * from './public-api';\n"]}

morgangit commented 3 years ago

@AlonsoK28 go here /node_modules/saturn-datepicker/datepicker.d.ts and find the following line of code and add the line defaultColor: ThemePalette

export declare class SatDatepicker<D> implements OnDestroy, CanColor {

...

 private _document;
/** Whenever datepicker is for selecting range of dates. */
defaultColor: ThemePalette // this line is added here to fix an issue after upgrading to angular 10 !!!

...

}`

save and ng serve your app good luck!

@paco76 when I go to this file all I see is:

`/**

  • Generated bundle index. Do not edit. / export from './public-api';

//# sourceMappingURL=saturn-datepicker.d.ts.map`

Any ideas? Can't get rid of this 'defaultColor' error...

In case anyone else is trying this, the small thing that threw me in @paco76 's suggested fix was the file path quoted:

/node_modules/saturn-datepicker/datepicker.d.ts

Actually it was:

/node_modules/saturn-datepicker/datepicker/datepicker.d.ts

Small thing but it threw me because there is a saturn-datepicker.ts file at the stated file-path. Anyway once I added the suggested line to the correct file this fix worked for me so thanks @paco76 !

davidoween commented 3 years ago

i have the same problem.

nathan-konv commented 3 years ago

Not sure and will verify tomorrow. But I got the feeling there are 2 published packages: saturn-datepicker and saturn-datepicker-ext. The latter one seems to have the fix but not the former one which I actually use. If anybody has a chance to try before I do. I am off for today :)

nathan-konv commented 3 years ago

And it seems that @angular/material v11.2.2 now offers to pick a range: https://material.angular.io/components/datepicker/overview#date-range-selection

nathan-konv commented 3 years ago

I confirm. I used the npm package saturn-datepicker-ext instead of saturn-datepicker and everything is working fine on my end. Will replace that by the newly supported range picker from angular material v11.2.2 soon.